diff mbox series

[v2,4/8] build: disable pointer to int conversion warnings for 32-bit

Message ID 20180703103119.15747-5-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series Enable 32-bit native builds with meson | expand

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Bruce Richardson July 3, 2018, 10:31 a.m. UTC
Converting a 32-bit pointer to a 64-bit integer is generally safe, but
generates a lot of warnings when compiling 32-bit code with meson. The
warnings are not flagged when using make, so just disable them for
32-bit meson builds.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Series-acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 config/meson.build | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/config/meson.build b/config/meson.build
index 50081b572..1531d9f0e 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -60,6 +60,10 @@  warning_flags = [
 	'-Wno-address-of-packed-member',
 	'-Wno-format-truncation'
 ]
+if cc.sizeof('void *') == 4
+# for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!!
+	warning_flags += '-Wno-pointer-to-int-cast'
+endif
 foreach arg: warning_flags
 	if cc.has_argument(arg)
 		add_project_arguments(arg, language: 'c')