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

[build] [Makefile]: Undefine _GNU_SOURCE for rglfw.c #4732

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

Peter0x44
Copy link
Contributor

@Peter0x44 Peter0x44 commented Jan 27, 2025

Currently, a warning about _GNU_SOURCE being redefined is emitted when compiling rglfw.c

In file included from rglfw.c:99:
external/glfw/src/posix_poll.c:27:9: warning: "_GNU_SOURCE" redefined
   27 | #define _GNU_SOURCE
      |         ^~~~~~~~~~~
<command-line>: note: this is the location of the previous definition

This can be avoided by not defining _GNU_SOURCE on the command line for this file.

Defining feature test macros in source code is not really good practice so this should probably reviewed in glfw itself, at least to maybe check
#ifdef _GNU_SOURCE first. But for now this change will suffice.

Fixes #4725

Currently, a warning about _GNU_SOURCE being redefined is emitted when
compiling rglfw.c

In file included from rglfw.c:99:
external/glfw/src/posix_poll.c:27:9: warning: "_GNU_SOURCE" redefined
   27 | #define _GNU_SOURCE
      |         ^~~~~~~~~~~
<command-line>: note: this is the location of the previous definition

This can be avoided by not defining _GNU_SOURCE on the command line for
this file.

Defining feature test macros in source code is not really good practice
so this should probably reviewed in glfw itself, at least to maybe check
 #ifdef _GNU_SOURCE first. But for now this change will suffice.

Fixes raysan5#4725
@raysan5 raysan5 merged commit 2492dd3 into raysan5:master Jan 27, 2025
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Jan 27, 2025

@Peter0x44 thanks for the review...

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.

[build] possible misuse of -D_GNU_SOURCE (also causing warning: "_GNU_SOURCE" redefined)
2 participants