projects/guix·blob python-team · refs

30 lines · 959 B

1Disable -Werror=nonnull on getcwd(0, 4096) because GCC incorrectly warns that
2the second argument should be NULL with recent glibc. See:
3
4https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96832
5https://sourceware.org/bugzilla/show_bug.cgi?id=26545
6
7diff --git a/nss/coreconf/nsinstall/nsinstall.c b/nss/coreconf/nsinstall/nsinstall.c
8--- a/nss/coreconf/nsinstall/nsinstall.c
9+++ b/nss/coreconf/nsinstall/nsinstall.c
10@@ -236,14 +236,20 @@ main(int argc, char **argv)
11 return 0;
12
13 if (!cwd) {
14+#pragma GCC diagnostic push
15+#pragma GCC diagnostic ignored "-Wnonnull"
16 cwd = GETCWD(0, PATH_MAX);
17+#pragma GCC diagnostic pop
18 if (!cwd)
19 fail("could not get CWD");
20 }
21
22 /* make sure we can get into todir. */
23 xchdir(todir);
24+#pragma GCC diagnostic push
25+#pragma GCC diagnostic ignored "-Wnonnull"
26 todir = GETCWD(0, PATH_MAX);
27+#pragma GCC diagnostic pop
28 if (!todir)
29 fail("could not get CWD in todir");
30 tdlen = strlen(todir);