[geeks] Compilation warnings...
Jonathan C. Patschke
jp at celestrion.net
Sat Nov 25 21:03:10 CST 2006
On Sat, 25 Nov 2006, Michael C. Vergallen wrote:
> Also is this a Solaris Compiler specific problem or is it just that
> code written for G.C.C. is looser in this and the Solaris compiler
> stricter on those things ....
If restaurants cooked food the way gcc validates code, a "well done"
steak would've passed through a kitchen while the grille was turned up,
but you wouldn't be assured of much more than that.
GCC isn't just poor at making sure code adheres to even the loosest
interpretations of the language standards, but also extends the language
in ways that create entirely new[0] language constructs that aren't
valid on other compilers. I suspect the problem is merely that the CUPS
maintainers hadn't bothered to run their code through someone else's
compiler, and GCC didn't have the presence of mind to issue that
particular warning[1].
The Good And Proper thing to do would be to fix the code, either by
bandaging it with a typecast or by changing the variable type. However,
as warnings go, that one probably -is- innocuous, unless the most
significant bit of that integer is likely to be flipped.
[0] Like the way it handles partial initializers.
[1] Or, as seems too often the case, the maintainers released the code
because it compiled with warnings instead of errors.
--
Jonathan Patschke ) "Some people grow out of the petty theft of
Elgin, TX ( childhood. Others grow up to be CEOs and
USA ) politicians." --Forrest Black
More information about the geeks
mailing list