jingfei195887 commented on code in PR #21853:
URL: https://github.com/apache/nuttx/pull/21853#discussion_r4597938237


##########
drivers/syslog/vsyslog.c:
##########
@@ -155,9 +157,15 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR 
va_list *ap)
 #  endif
 #endif
 
+#if defined(CONFIG_SYSLOG_COLOR_OUTPUT) || defined(CONFIG_SYSLOG_TIMESTAMP) || 
\

Review Comment:
   Thanks for taking a look, and sorry for not explaining this in the PR 
description.
   
   This guard isn't new: 0052ff2bd86 added it, and 2b274ba0231 removed it when 
the openlog ident became unconditional, because the header format string could 
no longer be empty.
   
   With this change the ident is optional again, so with SYSLOG_OPENLOG off and 
none of the other header options enabled (the default on DEFAULT_SMALL boards), 
the format string can be empty. Without the guard the call expands to 
`lib_sprintf_internal(&stream.common, );` and fails to build, and passing `""` 
instead triggers `-Wformat-zero-length`, which CI treats as an error. So I 
restored the original guard and only added `CONFIG_SYSLOG_OPENLOG` to it.
   
   If you'd prefer another way, for example moving the condition into a macro 
at the top of the file, I'm happy to change it.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to