summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2024-02-07 10:53:41 +0100
committerThomas Haller <thaller@redhat.com>2024-02-07 20:40:59 +0100
commit89e85717c95567211e81ff1e0cf8fd961ca7c117 (patch)
treea460a9c4bed9752ede2c6cf3d255165c8648f36c /meson.build
parentbcb6431bff4cc0b7ff2580df6db5337f3ff82752 (diff)
build: workaround compiler warning -Wnon-null in meson detection
Otherwise, `CFLAGS='-Wall -Werror' meson build` fails detection with: Running compile: Working directory: /data/src/glib/build/meson-private/tmpmw16de74 Code: #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> void some_func (void) { open(0, O_DIRECTORY, 0); } ----------- Command line: `cc /data/src/glib/build/meson-private/tmpmw16de74/testfile.c -o /data/src/glib/build/meson-private/tmpmw16de74/output.obj -c -Werror -Wall -D_FILE_OFFSET_BITS=64 -O0 -std=gnu99` -> 1 stderr: /data/src/glib/build/meson-private/tmpmw16de74/testfile.c: In function 'some_func': /data/src/glib/build/meson-private/tmpmw16de74/testfile.c:5:21: error: argument 1 null where non-null expected [-Werror=nonnull] 5 | open(0, O_DIRECTORY, 0); | ^~~~ In file included from /usr/include/features.h:503, from /usr/include/fcntl.h:25, from /data/src/glib/build/meson-private/tmpmw16de74/testfile.c:1: /usr/include/fcntl.h:212:12: note: in a call to function 'open' declared 'nonnull' 212 | extern int __REDIRECT (open, (const char *__file, int __oflag, ...), open64) | ^~~~~~~~~~ cc1: all warnings being treated as errors ----------- Checking if "open() option O_DIRECTORY" compiles: NO
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build2
1 files changed, 1 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 2a116b49e..ca0461fa8 100644
--- a/meson.build
+++ b/meson.build
@@ -1119,7 +1119,7 @@ if cc.compiles('''#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
void some_func (void) {
- open(0, O_DIRECTORY, 0);
+ open(".", O_DIRECTORY, 0);
}''', name : 'open() option O_DIRECTORY')
glib_conf.set('HAVE_OPEN_O_DIRECTORY', 1)
endif