[geeks] Compilation warnings...
Michael C. Vergallen
mvergall at telenet.be
Sat Nov 25 22:34:47 CST 2006
Jonathan C. Patschke wrote:
>
>
> 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.
>
>
Nice analogy ... however not completely true ... mostly it would be the
cook that was at fault because
he forgot to put it trough the grill....or the cook doesn't know how
to operate the grill ...a third possibility
is that the cook is trying to hide the fact that he is a bad cook...
> 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].
>
It was the GNU TLS package & sub-packages that was at fault ...the
programmers admit that they only work
on Linux with GCC. I half expected it to be ... the problem with
programmers who are only exposed to one
Unix flavor is that they don't seem to understand that what works for
them doesn't mean it is correct coding
practice that will deliver portable code...CUPS uses those libraries so
I have to compile them... It seems that
most G.P.L packages need 100 sub-packages to compile....is this because
instead of using a routine form an
other library in their code they just link the library even if the
routine could be implemented without the use of
someone else's code...I start to wonder ...because even gnupg now needs
other sub-packages to compile...all
by the same authors so they could have bundled their work so you
don't have stop & fetch some more code
every 5 minutes...just to find out that by the time you have built one
package you need and you start on the next
package you require you can start all over again because the
sub-packages you build are outdated and the
next package requires just one feature that was not in the previous
version ...makes me wonder if the whole
Object Oriented approche to coding is really that beneficial...
> 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.
>
I'll have a look at those three packets of code .... that make up the
GNU TLS library...and try and figure out what was done
badly...
> [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.
More information about the geeks
mailing list