Is it possible to use -Werror compile?

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 C. - http://zarb.org/~gc/

Hi,

In [email protected]
“[ruby-gnome2-devel-en] is it possible to use -Werror compile?” on
Tue, 8 Apr 2008 15:58:52 +0200,
“Guillaume C.” [email protected] 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

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 :slight_smile: That’s why I prefer computer checks
to human checks: the computer is instructed to always care :slight_smile:


Guillaume C. - http://zarb.org/~gc/

On Tue, Apr 08, 2008 at 03:58:52PM +0200, Guillaume C. 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 :slight_smile:

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…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs