Ruby Forum Ruby-Gnome 2 > is it possible to use -Werror compile?

Posted by Guillaume Cottenceau (Guest)
on 08.04.2008 15:59
(Received via mailing list)
I have noticed that when binding a non existent function (for example,
when you do a typo), the source code and library will still build.
Only a warning is emitted by gcc (warning: implicit declaration of
function 'foo').

Is there maybe a good reason to not activate -Werror? It would help
make these errors impossible..

--
Guillaume Cottenceau - http://zarb.org/~gc/
Posted by Kouhei Sutou (Guest)
on 08.04.2008 16:28
(Received via mailing list)
Hi,

In <dc3bf8580804080658k13c91668h18959329a97a6994@mail.gmail.com>
  "[ruby-gnome2-devel-en] is it possible to use -Werror compile?" on 
Tue, 8 Apr 2008 15:58:52 +0200,
  "Guillaume Cottenceau" <gcottenc@gmail.com> wrote:

> I have noticed that when binding a non existent function (for example,
> when you do a typo), the source code and library will still build.
> Only a warning is emitted by gcc (warning: implicit declaration of
> function 'foo').
> 
> Is there maybe a good reason to not activate -Werror? It would help
> make these errors impossible..

Does this mean the following?

Index: glib/src/lib/mkmf-gnome2.rb
===================================================================
--- glib/src/lib/mkmf-gnome2.rb  (revision 2999)
+++ glib/src/lib/mkmf-gnome2.rb  (working copy)
@@ -28,7 +28,7 @@
 STDOUT.flush
 if macro_defined?("__GNUC__", "")
   STDOUT.print "yes\n"
-  $CFLAGS += ' -Wall'
+  $CFLAGS += ' -Wall -Werror'
   $cc_is_gcc = true
 else
   STDOUT.print "no\n"

This may cause have_library/have_func failures in existing
extconf.rb. If we can confirm all extconf.rb, we will be
able to add -Werror.


BTW, a warning is not useful for this? We will be able to
find some warnings with 'make > /dev/null'. I hope there are
no warnings in Ruby-GNOME2 products.

Thanks,
--
kou
Posted by Guillaume Cottenceau (Guest)
on 08.04.2008 17:20
(Received via mailing list)
>   STDOUT.flush
>  able to add -Werror.
I was hoping for just adding that in the compile phase, not to mess
with have_* detections.

>  BTW, a warning is not useful for this? We will be able to
>  find some warnings with 'make > /dev/null'. I hope there are
>  no warnings in Ruby-GNOME2 products.

If you take care, it's useful. But if you don't care, which can
happen, then you can miss that :) That's why I prefer computer checks
to human checks: the computer is instructed to always care :)

--
Guillaume Cottenceau - http://zarb.org/~gc/
Posted by Sjoerd Simons (Guest)
on 10.04.2008 19:51
(Received via mailing list)
On Tue, Apr 08, 2008 at 03:58:52PM +0200, Guillaume Cottenceau wrote:
> I have noticed that when binding a non existent function (for example,
> when you do a typo), the source code and library will still build.
> Only a warning is emitted by gcc (warning: implicit declaration of
> function 'foo').
> 
> Is there maybe a good reason to not activate -Werror? It would help
> make these errors impossible..

I'm very much in favour of activating -Werror. But only on development 
builds.

Different compilers have different warnings, so while it might build 
fine win a
specific version of gcc, the same code can fail with another version or 
another
compiler. While -Werror is great for people hacking on the code, it can 
cause
problems for people that just want to do make ; make install :)

  Sjoerd
--
This is the theory that Jack built.
This is the flaw that lay in the theory that Jack built.
This is the palpable verbal haze that hid the flaw that lay in...