You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Jukka Laitinen <ju...@ssrc.tii.ae> on 2022/01/20 11:16:16 UTC

Question about backtrace_malloc

Hi,

Sorry if this question comes several times, it seems that for some 
reason my emails are not always coming through to the mailing list... So 
re-sending.

I started getting this build error from the latest NuttX:

misc/lib_execinfo.c:45:17: error: null argument where non-null required 
(argument 1) [-Werror=nonnull]
    45 |       int ret = sprintf(NULL, "%pS", *buffer++);
       |                 ^~~~~~~
In function 'backtrace_malloc',
     inlined from 'backtrace_symbols' at misc/lib_execinfo.c:67:10:
misc/lib_execinfo.c:45:17: error: null destination pointer 
[-Werror=format-overflow=]
    45 |       int ret = sprintf(NULL, "%pS", *buffer++);
       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

What is the deal with sprintf to NULL ptr?


Thanks,

Jukka