On Thu, Nov 14, 2002 at 10:15:50AM -0500, Paul Smith wrote: > %% Dominik Vogt <fvwm-workers@fvwm.org> writes: > > dv> When I compiled with "-Wall -Werror -g" I got no warnings at all, > dv> but with "-Wall -Werror -g -O2" it worked fine. > > Some kinds of warnings are not found unless you compile with > optimization. Enabling the optimizer allows the compiler to look much > more deeply at your code, and that can enable it to discover problems > that can't be found by a simple one-pass compilation. > > The most common such warnings are for unused variable: without > optimization on the compiler doesn't know enough about your code to > realize that a variable is never used; only with optimization turned on > will it keep enough state throughout the function to deliver that > warning.
Heck! Why isn't that mentioned in the gcc info page?! So I can't have debuggable code and many important warnings at the same time? What really pisses me off during debugging sessions is when gcc optimizes local variables away. > Note that the level of optimization doesn't matter; even -O is good > enough to find the extra warnings (but -O2 is the most common, and so > best-tested, level of optimization in GCC). Bye Dominik ^_^ ^_^ -- Visit the official FVWM web page at <URL:http://www.fvwm.org/>. To unsubscribe from the list, send "unsubscribe fvwm-workers" in the body of a message to [EMAIL PROTECTED] To report problems, send mail to [EMAIL PROTECTED]