system/uorb: Select the printf extension the format strings need.

Every topic's format string is printed through orb_info() or
orb_fprintf(), and both reach the data through "%pB", which is a NuttX
extension rather than a standard conversion.  UORB_FORMAT turns that
code on without turning the extension on, so a configuration that
enables the listener but not the debug output builds cleanly, runs, and
prints a pointer where the reading should be:

  sensor_voltage(now:4294968998000):0xc0203c98B

The address is the va_format the extension was supposed to expand, and
the trailing B is the conversion character being taken as ordinary
text.  Nothing warns, because to the compiler and to printf this is a
valid format string that means something else.

DEBUG_UORB already selects the extension, so the fault is invisible to
anyone who turned that on.  The two are independent options and only
one of them declared what it needed.  Move the select onto UORB_FORMAT,
which is the option that decides whether the format strings are
compiled in at all.

Signed-off-by: Justin Hammond <justin@dynam.ac>
This commit is contained in:
Justin Hammond 2026-09-20 16:53:00 +08:00 • committed by Xiang Xiao
parent 3cfb129dbf
commit 41a2c9d982

View file

@ -20,6 +20,7 @@ config UORB_STACKSIZE
config UORB_FORMAT
bool
select LIBC_PRINT_EXTENSION
default n
config UORB_LISTENER