aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-11-03 18:19:18 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2022-11-06 09:48:42 +0100
commitb5d3dac17077c4c7d9a90b4c76123ea80ac037da (patch)
tree854ef722372ecdf773827e9df2b0a6735670e45f /meson.build
parent8a0afbb2a4f7da5e6a542787ea90eb240e7ac65d (diff)
meson: avoid unused arguments of main() in compiler tests
meson.build has one test where "main" is declared unnecessarily with argc and argv arguments, but does not use them. Because the test needs -Werror too, HAVE_BROKEN_SIZE_MAX is defined incorrectly. Fix the test and, for consistency, remove argc and argv whenever they are not needed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build8
1 files changed, 4 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index 1d448272ab..cf3e517e56 100644
--- a/meson.build
+++ b/meson.build
@@ -2165,7 +2165,7 @@ config_host_data.set('CONFIG_SPLICE', cc.links(gnu_source_prefix + '''
config_host_data.set('HAVE_MLOCKALL', cc.links(gnu_source_prefix + '''
#include <sys/mman.h>
- int main(int argc, char *argv[]) {
+ int main(void) {
return mlockall(MCL_FUTURE);
}'''))
@@ -2210,7 +2210,7 @@ config_host_data.set('HAVE_FSXATTR', cc.links('''
config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles('''
#include <stdint.h>
#include <stdio.h>
- int main(int argc, char *argv[]) {
+ int main(void) {
return printf("%zu", SIZE_MAX);
}''', args: ['-Werror']))
@@ -2327,7 +2327,7 @@ config_host_data.set('CONFIG_AVX2_OPT', get_option('avx2') \
__m256i x = *(__m256i *)a;
return _mm256_testz_si256(x, x);
}
- int main(int argc, char *argv[]) { return bar(argv[0]); }
+ int main(int argc, char *argv[]) { return bar(argv[argc - 1]); }
'''), error_message: 'AVX2 not available').allowed())
config_host_data.set('CONFIG_AVX512F_OPT', get_option('avx512f') \
@@ -2341,7 +2341,7 @@ config_host_data.set('CONFIG_AVX512F_OPT', get_option('avx512f') \
__m512i x = *(__m512i *)a;
return _mm512_test_epi64_mask(x, x);
}
- int main(int argc, char *argv[]) { return bar(argv[0]); }
+ int main(int argc, char *argv[]) { return bar(argv[argc - 1]); }
'''), error_message: 'AVX512F not available').allowed())
have_pvrdma = get_option('pvrdma') \