Skip to contentSkip to conversation

bluez: Fix invalid-pp-token warning found with clang

PATCH New Khem Raj 1 participant 1 message Jul 24, 2025

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v6 1/1 bluez: Fix invalid-pp-token warning found with clang

We add FIRMWARE_DIR via CFLAGS using escapes for string and clang option parser flags it

<command line>:4:23: warning: missing terminating '"' character [-Winvalid-pp-token]
4 | #define FIRMWARE_DIR \"/usr/lib/firmware\"
| ^

emitting this warning during configure means some tests fail wrongly. e.g. test for enable -fPIC -DPIC, which results in textrels in libbbluetooth.so

Pass the string definition using single quotes to avoid the shell "eating" the quotes and other characters

This works well across gcc and clang

---
v6: Use single quotes instead of escapes

 meta/recipes-connectivity/bluez5/bluez5.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-connectivity/bluez5/bluez5.inc +1 -1
index 3b414433cf3..48aeff0aeea 100644
@@ -81,7 +81,7 @@ EXTRA_OECONF = "\
   --without-zsh-completion-dir \
 "
 
-CFLAGS += "-DFIRMWARE_DIR=\\"${nonarch_base_libdir}/firmware\\""
+CFLAGS += "-DFIRMWARE_DIR='"${nonarch_base_libdir}/firmware"'"
 
 # bluez5 builds a large number of useful utilities but does not
 # install them.  Specify which ones we want put into ${PN}-noinst-tools.