diff options
author | Michal Privoznik <mprivozn@redhat.com> | 2023-05-30 12:31:23 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-06-06 09:42:14 +0200 |
commit | 09a49afeae2542993d4cdc5d7af22abdfce7a3ba (patch) | |
tree | 840d62cb13ac3fb40ab6fd0fe1674a33100bddde /meson_options.txt | |
parent | 369081c4558e7e940fa36ce59bf17b2e390f55d3 (diff) | |
download | qemu-09a49afeae2542993d4cdc5d7af22abdfce7a3ba.zip qemu-09a49afeae2542993d4cdc5d7af22abdfce7a3ba.tar.gz qemu-09a49afeae2542993d4cdc5d7af22abdfce7a3ba.tar.bz2 |
meson: Avoid implicit declaration of absent functions
While detecting a presence of a function via 'cc.links()'
gives desired result (i.e. detects whether function is present),
it also produces a warning on systems where the function is not
present (into meson-log.txt), e.g.:
qemu.git/build/meson-private/tmph74x3p38/testfile.c:2:34: \
warning: implicit declaration of function 'malloc_trim' [-Wimplicit-function-declaration]
And some distributions (e.g. Gentoo) parse the meson log and
consider these erroneous because it can lead to feature
misdetection (see [1]).
We can check whether given function exists via
'cc.has_function()' or whether STATX_* macros exist via
'cc.has_header_symbol()'.
1: https://wiki.gentoo.org/wiki/Modern_C_porting
Resolves: https://bugs.gentoo.org/898810
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Message-Id: <8e02776d18595a1c575c90a189ff65f1785f76ca.1685442612.git.mprivozn@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson_options.txt')
0 files changed, 0 insertions, 0 deletions