Transition from macro existence checking (`#ifdef(foo)`) to value checking (`#if foo == 1`) in general
Open
@wrtobin is already working on this.
Since Dec 6, 2022.
type: cleanup / refactor
- Dominant language
- C++
- Stars
- 287
- Forks
- 109
- Avg merge
- 4d 41m
- Merged PRs (30d)
- 5
Description
Detecting macro existence via #ifdef can lead to esoteric compilation problems due to the visibility of symbols depending on the set of included headers in a compilation scope.
Detecting instead the value of a macro that should always be defined will result in an error when the macro isn't defined and make the issues that can be caused by the above almost trivial to track down.
We might also want to take advantage of #cmakedefine01 as part of this to change our config header from defined/undefined to #define FOO 0/1 consistently.
- @bmhan12 Find out the motivation for using
#if defined()in AXOM, and drawbacks to proposal.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.