lua-users home
lua-l archive

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


David Smead wrote:
[...]
For compile only - you probably need some include dirs and libs.
gcc  -c -ggdb -Wall -Werror -Wfatal-errors

-Werror is dead handy for development, but may I make a plea to remember to turn it *off* for distribution?

The problem is that while the C standard mandates when compilers produce errors, it does not mandate when they produce warnings. So, different compilers produce different warnings. This means that with this option, working, non-broken code that compiles fine on compiler X will fail to compile on compiler Y, because Y is producing a warning in a place where X did not.

The gcc maintainers leave -Werror turned on, with the entirely unfunny consequence that building gcc 4.Y on gcc 4.X where certain combinations of X and Y will frequently fail to work out of the box:

http://www.cowlark.com/2009-07-04-building-gcc/

--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ "They laughed at Newton. They laughed at Einstein. Of course, they
│ also laughed at Bozo the Clown." --- Carl Sagan