Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify usage of #if vs #ifdef and standardize everywhere #1370

Open
lukasdreyer opened this issue Feb 3, 2025 · 2 comments
Open

Clarify usage of #if vs #ifdef and standardize everywhere #1370

lukasdreyer opened this issue Feb 3, 2025 · 2 comments
Assignees
Labels
next release For the next release priority: high Should be solved as soon as possible

Comments

@lukasdreyer
Copy link
Collaborator

Feature request

Is your feature request related to a problem? Please describe.
It is not clear to me, whether #if T8_ENABLE_DEBUG or #ifdef T8_ENABLE_DEBUG is the preferred variant to write in t8code.

Currently, the usage is split in half:
https://github.com/search?q=repo%3ADLR-AMR%2Ft8code%20%23ifdef%20T8_ENABLE_DEBUG&type=code
https://github.com/search?q=repo%3ADLR-AMR%2Ft8code%20%23if%20T8_ENABLE_DEBUG&type=code

Describe the solution or feature you'd like
Clarify, which variant is preferred and adapt accordingly.

Estimated priority
Which of these is most applicable (remove the others):

"Priority: medium" Should be solved within half a year

@Davknapp
Copy link
Collaborator

Davknapp commented Feb 3, 2025

We decided for #if T8_ENABLE_DEBUG

@Davknapp Davknapp added next release For the next release priority: high Should be solved as soon as possible labels Feb 3, 2025
@cburstedde
Copy link
Collaborator

For p4est and sc we use #ifdef: If a feature is not enabled, the macro is indeed not defined at all and #if would throw an error. This seems to be the case with both autoconf and CMake. Wondering why #if seems to be ok with t8code and CMake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next release For the next release priority: high Should be solved as soon as possible
Projects
None yet
Development

No branches or pull requests

3 participants