Skip to content

Fix incorrect #ifdef A && B usage#10

Closed
certik wants to merge 1 commit intoBerkeleyLab:mainfrom
certik:ifdef
Closed

Fix incorrect #ifdef A && B usage#10
certik wants to merge 1 commit intoBerkeleyLab:mainfrom
certik:ifdef

Conversation

@certik
Copy link
Contributor

@certik certik commented Feb 25, 2026

In Fortran preprocessor, the usage:

#ifdef A && B

is treated as #ifdef A and the && B is ignored as "extra tokens", which is most likely not what was intended. Most likely what was intended is:

#if defined(A) && defined(B)

So this PR makes this change.

In Fortran preprocessor, the usage:

    #ifdef A && B

is treated as `#ifdef A` and the `&& B` is ignored as "extra tokens",
which is most likely not what was intended. Most likely what was
intended is:

    #if defined(A) && defined(B)

So this PR makes this change.
allocate(DA, mold=A)

#ifdef HAVE_DO_CONCURRENT_TYPE_SPEC_SUPPORT && HAVE_LOCALITY_SPECIFIER_SUPPORT
#if defined(HAVE_DO_CONCURRENT_TYPE_SPEC_SUPPORT) && defined(HAVE_LOCALITY_SPECIFIER_SUPPORT)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually what was likely intended is:

Suggested change
#if defined(HAVE_DO_CONCURRENT_TYPE_SPEC_SUPPORT) && defined(HAVE_LOCALITY_SPECIFIER_SUPPORT)
#if HAVE_DO_CONCURRENT_TYPE_SPEC_SUPPORT && HAVE_LOCALITY_SPECIFIER_SUPPORT

@rouson can you clarify?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure this is the correct fix: #11.

@certik
Copy link
Contributor Author

certik commented Feb 25, 2026

Closing in favor of #11.

@certik certik closed this Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant