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

[Bug]: _GNU_SOURCE macro defined twice in the codebase #7957

Closed
rdmark opened this issue Sep 7, 2024 · 2 comments
Closed

[Bug]: _GNU_SOURCE macro defined twice in the codebase #7957

rdmark opened this issue Sep 7, 2024 · 2 comments
Assignees
Labels

Comments

@rdmark
Copy link

rdmark commented Sep 7, 2024

Contact Details

No response

Version

5.7.2

Description

The _GNU_SOURCE macro is defined twice under the exact same #ifdef logic in the WolfSSL codebase:

This means that you will always get compiler warnings. I believe this is harmless, but adds noise to the log that may distract from actual bugs...

Reproduction steps

  1. Build the library (e.g. embedded in the Netatalk build system)
  2. Observe the compiler log

Relevant log output

[206/318] Compiling C object libatalk/ssl/libssl.a.p/src_ssl.c.o
In file included from ../libatalk/ssl/wolfcrypt/src/misc.c:29,
                 from ../libatalk/ssl/src/ssl.c:45:
./config.h:800: warning: "_GNU_SOURCE" redefined
  800 | #define _GNU_SOURCE 1
      | 
../libatalk/ssl/src/ssl.c:31: note: this is the location of the previous definition
   31 |     #define _GNU_SOURCE
      | 
In file included from ../libatalk/ssl/src/x509.c:24,
                 from ../libatalk/ssl/src/ssl.c:23296:
./config.h:800: warning: "_GNU_SOURCE" redefined
  800 | #define _GNU_SOURCE 1
      | 
In file included from ../libatalk/ssl/src/ssl.c:21882:
../libatalk/ssl/src/bio.c:30: note: this is the location of the previous definition
   30 |     #define _GNU_SOURCE
      |
@rdmark
Copy link
Author

rdmark commented Sep 7, 2024

Proposing #7958 as a naive solution, but I would be curious if there is a better way to avoid the collision (define it in a header?)

@rdmark
Copy link
Author

rdmark commented Sep 13, 2024

#7971 resolves all my issues. Thank you very much for your support!

@rdmark rdmark closed this as completed Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants