Re: unused for all platforms

Am Mon, 2002-02-18 um 09.49 schrieb Miroslaw Dobrzanski-Neumann:

> As I know there is no compiler that generates code for statements like
> "p = *&p"

Actually that would have to be "p = p" which is valid C and means
what it reads (i.e. Initialise p with the value it had before, whatever
that was; probably random). There was some hefty discussion on the gcc
mailinglist whether that really is the proper fix to prevent the
"variable blah might be used uninitialised" warnings and the only
conclusion they have reached was that it's totally valid C but should
be discouraged.

While that leads to better code than initialising with 0 it's quite
distraction not only to the reader of the source but also to some
optimisation units.

Better would be to use the special attributes of gcc or pragmas of
other compilers to hint the compiler into the right direction. Of course
avoiding unused parameters would be the best idea after all.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]