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

Avoid redefining _GNU_SOURCE #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thesamesam
Copy link

It's harmless, but with 3dea342, we get:

x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/sys-fs/libeatmydata-131/work/libeatmydata-131     -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -Wreturn-type      -ggdb3 -Werror=implicit-function-declaration -Werror=implicit-int -c -o libeatmydata/test/tst-cancel4.o /var/tmp/portage/sys-fs/libeatmydata-131/work/libeatmydata-131/libeatmydata/test/tst-cancel4.c
/var/tmp/portage/sys-fs/libeatmydata-131/work/libeatmydata-131/libeatmydata/test/tst-cancel4.c:28: warning: "_GNU_SOURCE" redefined
   28 | #define _GNU_SOURCE
      |
In file included from /var/tmp/portage/sys-fs/libeatmydata-131/work/libeatmydata-131/libeatmydata/test/tst-cancel4.c:26:
./config.h:115: note: this is the location of the previous definition
  115 | # define _GNU_SOURCE 1
      |

This is because we already have AC_USE_SYSTEM_EXTENSIONS in configure.ac which sets GNU_SOURCE in config.h for us.

We also explicitly add a config.h include to tst-invalidvd.c instead of relying on it via portability.h.

It's harmless, but with 3dea342, we get:
```
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/sys-fs/libeatmydata-131/work/libeatmydata-131     -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -Wreturn-type      -ggdb3 -Werror=implicit-function-declaration -Werror=implicit-int -c -o libeatmydata/test/tst-cancel4.o /var/tmp/portage/sys-fs/libeatmydata-131/work/libeatmydata-131/libeatmydata/test/tst-cancel4.c
/var/tmp/portage/sys-fs/libeatmydata-131/work/libeatmydata-131/libeatmydata/test/tst-cancel4.c:28: warning: "_GNU_SOURCE" redefined
   28 | #define _GNU_SOURCE
      |
In file included from /var/tmp/portage/sys-fs/libeatmydata-131/work/libeatmydata-131/libeatmydata/test/tst-cancel4.c:26:
./config.h:115: note: this is the location of the previous definition
  115 | # define _GNU_SOURCE 1
      |
```

This is because we already have `AC_USE_SYSTEM_EXTENSIONS` in configure.ac
which sets GNU_SOURCE in config.h for us.

We also explicitly add a config.h include to tst-invalidvd.c instead
of relying on it via portability.h.
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