This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 0d6b51772db0f4d227269d6b2daff4844319c2cb
Author: Marco Casaroli <[email protected]>
AuthorDate: Sun Nov 8 18:17:09 2026 +0100

    sched_note: Do not strip the sched_note_printf() format in C++.
    
    With CONFIG_DRIVERS_NOTE_STRIP_FORMAT, sched_note_printf() finds the
    type of each argument with _Generic, which C++ does not have.  With
    CONFIG_SYSLOG_TO_SCHED_NOTE, every syslog() call in C++ code is a
    sched_note_printf() call, so the C++ library does not build:
    
      libminiabi/libxx_new.cxx:63:7: error: '_Generic' was not declared
      in this scope
    
    In C++, use the sched_note_printf() of the configuration without
    CONFIG_DRIVERS_NOTE_STRIP_FORMAT: keep the format string and give
    type 0.  C code does not change.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 include/nuttx/sched_note.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/nuttx/sched_note.h b/include/nuttx/sched_note.h
index 14cb25f45c0..bb30b2a9f53 100644
--- a/include/nuttx/sched_note.h
+++ b/include/nuttx/sched_note.h
@@ -191,9 +191,10 @@
 #define sched_note_vprintf(tag, fmt, va) \
         sched_note_vprintf_ip(tag, SCHED_NOTE_IP, fmt, 0, &(va))
 
-#ifdef CONFIG_DRIVERS_NOTE_STRIP_FORMAT
+#if defined(CONFIG_DRIVERS_NOTE_STRIP_FORMAT) && !defined(__cplusplus)
 /* The type tag describes at most 14 arguments.  A call with more arguments
- * keeps its format string and gives type 0.
+ * keeps its format string and gives type 0.  C++ has no _Generic, so C++
+ * calls keep their format string too.
  */
 
 #  define sched_note_printf(tag, fmt, ...) \

Reply via email to