cppcheck sept 18 redux

Detlef Riekenberg wine.dev at web.de
Sat Sep 26 04:24:44 CDT 2009


On Di, 2009-09-22 at 07:46 -0700, Chris Robinson wrote:
> so dmW->dmFormName is the same as &(*dmW).dmFormName,

When the target is an array, the address of the first member is
returned:
dmW->fmFormName is:  &(dmW->dmFormName[0])

similar:
 char buffer[32];
 printf("buffer at %p\n", buffer);

which is only a shortcut for:
printf("buffer[0] at %p\n", &buffer[0]);

> However, since GCC will remove deadcode and it's simple to see the dereference 
> isn't needed, it just optimizes it away. 
No, removing deadcode must be enabled. You can use every compiler.

> but I'm not so 
> sure that it's guaranteed by the C standard. Is it?

Yes.


-- 
 
By by ... Detlef




More information about the wine-devel mailing list