diff options
author | Thomas Haller <thaller@redhat.com> | 2024-02-07 10:53:41 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2024-02-07 11:49:57 +0100 |
commit | 8ea0f7d0457e9c1d52c3dd8091e603b670a7af1f (patch) | |
tree | 633d02b51fbf3b3fdd54007e98dc65585ef08cd5 /meson.build | |
parent | a040562d6c6163a28617ce4cf26d00e68dac2f3c (diff) |
build: fix detection of int64_t_typedef in meson build check
Otherwise, `CFLAGS='-Wall -Werror' meson build` fails with:
Checking for size of "ssize_t" : 8
Running compile:
Working directory: ./glib/build/meson-private/tmpgwlkasyk
Code:
#if defined(_AIX) && !defined(__GNUC__)
#pragma options langlvl=stdc99
#endif
#pragma GCC diagnostic error "-Wincompatible-pointer-types"
#include <stdint.h>
#include <stdio.h>
int main () {
int64_t i1 = 1;
long *i2 = &i1;
return 1;
}
-----------
Command line: `cc ./glib/build/meson-private/tmpgwlkasyk/testfile.c -o ./glib/build/meson-private/tmpgwlkasyk/output.obj -c -O3 -Werror -Wall -D_FILE_OFFSET_BITS=64 -O0 -std=gnu99` -> 1
stderr:
./glib/build/meson-private/tmpgwlkasyk/testfile.c: In function 'main':
./glib/build/meson-private/tmpgwlkasyk/testfile.c:9:29: error: unused variable 'i2' [-Werror=unused-variable]
9 | long *i2 = &i1;
| ^~
cc1: all warnings being treated as errors
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/meson.build b/meson.build index c14b7f5f1..abff7f522 100644 --- a/meson.build +++ b/meson.build @@ -1553,6 +1553,7 @@ if long_long_size == long_size int main () { int64_t i1 = 1; long *i2 = &i1; + (void) i2; return 1; }''', name : 'int64_t is long') int64_t_typedef = 'long' @@ -1565,9 +1566,12 @@ if long_long_size == long_size int main () { int64_t i1 = 1; long long *i2 = &i1; + (void) i2; return 1; }''', name : 'int64_t is long long') int64_t_typedef = 'long long' + else + error('Cannot detect int64_t typedef') endif endif |