LWN.net Logo

Removing uninitialized_var()

Removing uninitialized_var()

Posted Dec 20, 2012 6:50 UTC (Thu) by error27 (subscriber, #8346)
Parent article: Removing uninitialized_var()

I've always thought uninitialize_var() macro was a bit ugly to look at.

The problem with setting pointers to NULL is that it silences the GCC warning, but it now triggers a "dereferencing NULL" warning in Smatch. Uninitialize_var() solved this problem nicely. I wish there were some macro that Smatch could understand.

struct foo *p = SILENCE_GCC;


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds