Subject: Re: gcc -Wall

From: Dominik Vogt <[email-masked]>
Date: Mon, 5 Apr 1999 22:53:09 +0200

On Sun, Apr 04, 1999 at 05:40:26PM -0400, Steve Robbins wrote:
> Hi Dominik,
> 
> As I mentioned previously, I had just cleaned up the last of the -Wall
> warnings.  Then you did a big commit ;-)
> 
> Some or all of these come from your commit, so maybe you want to have a
> look?
> 
> ../../fvwm/builtins.c:592: warning: implicit declaration of function
> `add_another_menu_item'
> ../../fvwm/builtins.c:620: warning: suggest parentheses around assignment
> used as truth value
> ../../fvwm/builtins.c:621: warning: implicit declaration of function
> `set_last_added_item'
> ../../fvwm/builtins.c:1703: warning: implicit declaration of function
> `SetMenuCursor'
> ../../fvwm/functions.c:35: warning: `repeat_last_top_function' defined but
> not used
> ../../fvwm/functions.c:37: warning: `repeat_last_menu' defined but not
> used
> ../../fvwm/functions.c:38: warning: `repeat_last_fvwm_window' defined but
> not used
> ../../fvwm/fvwm.c:744: warning: unused variable `w'
> ../../fvwm/menus.c:4074: warning: implicit declaration of function
> `set_last_added_item'

Grrr, isn't there a way to tell the compiler to generate an error
when the prototype is missing? If you have an 'implicit declaration'
you may as well have done something totally wrong.

Bye

Dominik ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
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-masked].
To report problems, send mail to [email-masked]

---

From: Steve Robbins <[email-masked]>
Date: Mon, 5 Apr 1999 17:34:34 -0400 (EDT)

Hi gang,

You may have noticed a lot of "gcc -Wall cleanup" commit messages from me
recently.  ;-)

Well, it's basically finished.  I can now compile all of fvwm (Dominik's
commits from yesterday excluded) with "gcc -Wall" and get NO warnings. 

I like to use "gcc -Wall" as a quick stupidity-filter after changing some
code.  It is not comprehensive like "lint", but at least it tells me if I
forget to prototype a function, and it catches some other common errors
like:
	if ( a = b )

Now that the code is clean enough to make -Wall a viable option, I move we
keep it that way. 

Opinions?

> when the prototype is missing?

I'm using "gcc -Wall -Werror", which does the trick!  ;-)

> If you have an 'implicit declaration'

Mmm... an even more likely bug is when you get the warning "suggest
parentheses around assignment used as truth value"  (builtins.c:620)

Or even: "statement has no effect", generated by a line such as the
following (deep in some module code):

	a == b;