http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25702



David Csirmaz <forgcc at calmarius dot net> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

                 CC|                            |forgcc at calmarius dot net



--- Comment #8 from David Csirmaz <forgcc at calmarius dot net> 2013-01-04 
15:37:44 UTC ---

I encounter this mistake regularly too. 



But you have shown examples why shouldn't we need warning for that.



But I have a different idea. The sizeof operator is usually used to pass buffer

sizes to a function, along with pointer to the buffer itself.



So when you have a function call like:



dumpbuf(a, sizeof(a))



It's almost certainly wrong if `a` is a pointer, isn't it?



So basically the rule would be: if x and sizeof(x) is in the same expression

and x is a pointer, issue a warning.

Reply via email to