meson: conf_data.set() causes meson warnings
Notice that some warnings in meson build
output like that,
../os/meson.build:24: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
../os/meson.build:27: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
../os/meson.build:30: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
../os/meson.build:33: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
../os/meson.build:36: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
../os/meson.build:39: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
../os/meson.build:45: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
../os/meson.build:49: WARNING: Trying to compare values of different types (str, bool) using !=.
The result of this is undefined and will become a hard error in a future Meson release.
After a glimpse of meson.build, I found this in include/meson.build
:
conf_data.set('HAVE_REALLOCARRAY', cc.has_function('reallocarray', dependencies: libbsd_dep) ? '1' : false)
conf_data.set('HAVE_SETEUID', cc.has_function('seteuid') ? '1' : false)
conf_data.set('HAVE_SETITIMER', cc.has_function('setitimer') ? '1' : false)
conf_data.set('HAVE_SHMCTL64', cc.has_function('shmctl64') ? '1' : false)
conf_data.set('HAVE_SIGACTION', cc.has_function('sigaction') ? '1' : false)
conf_data.set('HAVE_SIGPROCMASK', cc.has_function('sigprocmask') ? '1' : false)
conf_data.set('HAVE_STRCASECMP', cc.has_function('strcasecmp') ? '1' : false)
conf_data.set('HAVE_STRCASESTR', cc.has_function('strcasestr') ? '1' : false)
conf_data.set('HAVE_STRLCAT', cc.has_function('strlcat', dependencies: libbsd_dep) ? '1' : false)
conf_data.set('HAVE_STRLCPY', cc.has_function('strlcpy', dependencies: libbsd_dep) ? '1' : false)
conf_data.set('HAVE_STRNCASECMP', cc.has_function('strncasecmp') ? '1' : false)
conf_data.set('HAVE_STRNDUP', cc.has_function('strndup') and cc.has_header_symbol('string.h', 'strndup') ? '1' : false)
conf_data.set('HAVE_TIMINGSAFE_MEMCMP', cc.has_function('timingsafe_memcmp') ? '1' : false)
Why not just to set these flags to 1
or 0
?
P.S.:
- The Meson build system - Version: 0.55.0 - Source dir: /home/luc/github/xserver - Build dir: /home/luc/github/xserver/build - Build type: native build - Project name: xserver - Project version: 20.99.1 - C compiler for the host machine: cc (gcc 8.4.0 "cc (Ubuntu 8.4.0-3ubuntu2) 8.4.0") - C linker for the host machine: cc ld.bfd 2.34 - Host machine cpu family: x86_64 - Host machine cpu: x86_64
Edited by Luc Ma