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;
