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

porting/linux: Fix warning about __USE_GNU redefinition #1903

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

sjanc
Copy link
Contributor

@sjanc sjanc commented Oct 31, 2024

Simply define this before including any systema headers.

g -D_GNU_SOURCE -o ../../../porting/npl/linux/src/os_atomic.o ../../
../porting/npl/linux/src/os_atomic.c
../../../porting/npl/linux/src/os_atomic.c:21:9: warning: "__USE_GNU" redefined
21 | #define __USE_GNU
| ^~~~~~~~~
In file included from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdint.h:26,
from /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h:9,
from ../../../porting/npl/linux/src/os_atomic.c:20:
/usr/include/features.h:409:10: note: this is the location of the previous definition
409 | # define __USE_GNU 1
| ^~~~~~~~~

Simply define this before including any systema headers.

g -D_GNU_SOURCE  -o ../../../porting/npl/linux/src/os_atomic.o ../../
    ../porting/npl/linux/src/os_atomic.c
../../../porting/npl/linux/src/os_atomic.c:21:9: warning: "__USE_GNU" redefined
   21 | #define __USE_GNU
      |         ^~~~~~~~~
In file included from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdint.h:26,
                 from /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h:9,
                 from ../../../porting/npl/linux/src/os_atomic.c:20:
/usr/include/features.h:409:10: note: this is the location of the previous definition
  409 | # define __USE_GNU      1
      |          ^~~~~~~~~
@github-actions github-actions bot added the size/XS Extra small PR label Oct 31, 2024
@sjanc sjanc merged commit a45a15c into apache:master Nov 4, 2024
19 checks passed
@sjanc sjanc deleted the port_linux branch November 4, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Extra small PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant