[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] CVS Errors
Hi,
On lauantai 08 tammikuu 2011, Thomas Juerges wrote:
> On 2011-01-08 13:00, Eero Tamminen wrote:
> > Solution to -Werror is not to use it. :-)
>
> That is certainly the wrong solution.
>
> Warnings are reported for a reason. There is a probability > 0 that
> those warnings will be reported as errors in the future compiler
> releases. Warnings do not exist for the amusement of the crowd but to
> make the developer aware that the code causing the warning may or will
> cause unexpected results. Use of the -Werror option should be mandatory
> and it is beyond me what the problem with fixing warnings is.
Valid warnings should be of course fixed. What I'm saying is that -Werror
isn't necessarily the best way to *catch* them because it prevents builds
and shows you just the issues in the first C-file where the issues were
encountered.
Note that there can also be "unfixable" warnings:
* GCC generates sometimes bogus warnings (it's rare, but there are bugs
about this in GCC bugzilla) and these differ between GCC versions
* Warning may come e.g. from a system header over which you don't have
control
* Fixing a warning properly may be too much work (e.g. require redesign
to propagate constness through everything)
* With portable software, different systems may trigger different warnings
(from above three categories)
Sometimes it's best just to disable some warning, but usually I think it
better to leave & comment a warning from code with TODO than disable
some specific GCC compiler warning completely.
- Eero