sjanc commented on code in PR #3530:
URL: https://github.com/apache/mynewt-core/pull/3530#discussion_r2493337304


##########
sys/log/modlog/include/modlog/modlog.h:
##########
@@ -190,7 +190,8 @@ int modlog_foreach(modlog_foreach_fn *fn, void *arg);
  * @param level                 The severity of the log entry to write.
  * @param msg                   The "printf" formatted string to write.
  */
-void modlog_printf(uint8_t module, uint8_t level, const char *msg, ...);
+void modlog_printf(uint8_t module, uint8_t level, const char *msg, ...)
+    __attribute((format(printf, 3, 4)));

Review Comment:
   modlog.h is included in a lot of modules in core,  only osdp and oic require 
fixes for this to be enabled?
   
   maybe it should be under MYNEWT_VAL (at least for time being) so that no 
unexpected build errors are introduced?
   
   (especially that currently we always enable Werror - which we should make 
opt-in option anyway)



##########
net/oic/src/port/mynewt/ip_adaptor.c:
##########
@@ -165,7 +166,7 @@ oc_send_buffer_ip6_int(struct os_mbuf *m, int is_mcast)
             to.msin6_scope_id = itf2.mif_idx;
             rc = mn_sendto(oc_ucast6, n, (struct mn_sockaddr *) &to);
             if (rc != 0) {
-                OC_LOG_ERROR("Failed to send buffer %u on itf %d\n",
+                OC_LOG_ERROR("Failed to send buffer %u on itf %" PRIu32 "\n",

Review Comment:
   I'm really not a huge fan of PRI syntax... especially that it leads to 
inconsistent print formatting, eg here you don't use PRIu16 for omp_len
   
   what do you think on using %u here and casting msin6_scope_id to (unsigned 
int) ?



-- 
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