On Thu, Nov 14, 2002 at 02:12:28PM +0100, Dominik Vogt wrote:
> script.y had this code:
> 
>   foo *some_func()
>   {
>     if (...)
>     {
>       ...
>       return something;
>     }
>     else
>     {
>       return NULL;
>       *s = 0;
>     }
>   }
> 
> This generates a compiler warning:
> 
>   script.y: In function `Depile':
>   script.y:132: warning: control reaches end of non-void function
>

I am surprised by the warning description. A more natural warning
will be something like "code after end of function". I get the
warning if, say, I remove "return NULL".

Note that the code you fix in script.c is there since an eternity
I think. At least it is in 2.4. So, the question why you do not
get such a warning before?
  
> Olivier, are you sure your gcc works correctly.  You said you
> compile with -Wall, so you should have seen this warning/bug.  I
> had a problem with gcc a while ago.  When I compiled with
> "-Wall -Werror -g" I got no warnings at all, but with
> "-Wall -Werror -g -O2" it worked fine.  Are you sure you are not
> running into a similar problem?  Can you post one of your compiler
> commands?

I (want to) compile like this:

        $ make

which gives:

gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../..  -I/opt/X11R6-cvs/include \
-I/opt/X11R6-cvs/include/freetype2 -I/opt/X11R6-cvs/include \
-I/opt/X11R6-cvs/include -I/opt/X11R6-cvs/include -I/usr/local/include/fribidi \
-DFVWM_DATADIR=\"/opt/fvwm/share/fvwm\" \
-g -O2 -Wall -Wno-implicit-int -c script.c
       ^^^^^^^^^^^^^^^^^^^^^^^

as I have a colored gcc I rarely miss a warning. But, as I say in a
previous mail I do not know why "-Wno-implicit-int" has been added.
So sometime I miss an implicit int declaration. I would like to
remove this "-Wno-implicit-int" (and we may add an option, --developer,
to configure, which adds -Werror if gcc is the compiler)

Tim I think that you added "-Wno-implicit-int". Why?

Olivier
--
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]

Reply via email to