[DTrace-devel] [PATCH 5/6] Possible uninitialized 'last' variable in usdt_copyin_data()
Nick Alcock
nick.alcock at oracle.com
Tue Apr 14 21:43:11 UTC 2026
On 31 Mar 2026, eugene loh told this:
> From: Eugene Loh <eugene.loh at oracle.com>
>
> Some compilers warn:
>
> libcommon/usdt_parser.c: In function ‘usdt_copyin_data’:
> libcommon/usdt_parser.c:191:15: warning:
> ‘last’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> last->next = blk;
> ~~~~~~~~~~~^~~~~
>
> Change the "if" check to make it easier for compilers to recognize
> that "last" will be initialized (and non-NULL even!).
>
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Ugh. Still, if it works, it works, and it's semantically the same.
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
--
NULL && (void)
More information about the DTrace-devel
mailing list