svn commit: r230354 - head/usr.sbin/makefs

Dimitry Andric dim at FreeBSD.org
Mon Jan 23 12:25:07 UTC 2012


On 2012-01-23 05:28, Hiroki Sato wrote:
...
>   I don't think it is needed.  The makefs utility is a special case
>   because it will probably diverge from the upstream to support
>   FreeBSD-specific feature in the future (this is one of the reasons
>   why it is not in contrib/).  It didn't happen so far, however.
>
>   By the way, does gcc46 no longer allow unused code?  Generally
>   speaking, I think it is enough to clean up unused code only when we
>   actually change the code.

The warnings are not about unused code, but about variables which are
assigned, but then never referenced anymore.  Sometimes this is just a
cosmetic issue, and the compiler will hopefully optimize out the
unreferenced variable(s).  In other situations there are real bugs.

In any case, gcc 4.5 and 4.6 just enable more warnings by default, and
when using -Wall; in particular the "variable set but not used" one.

This warning should really be suppressed when WARNS is set to a low
level, such as with makefs (it has WARNS?=2).

Attached diff makes it so, for gcc45 and gcc46.  It uses the same
approach as I added earlier for clang.  It can also be easily extended
to other warnings.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc46-warnings-1.diff
Type: text/x-diff
Size: 662 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20120123/3f67ef34/gcc46-warnings-1.bin


More information about the svn-src-head mailing list