public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Can I build gcc so -Wall option is always on ?
@ 2009-12-24 17:01 Dennis Clarke
  2009-12-24 21:46 ` Dr. David Kirkby
  0 siblings, 1 reply; 10+ messages in thread
From: Dennis Clarke @ 2009-12-24 17:01 UTC (permalink / raw)
  To: Dr. David Kirkby; +Cc: gcc-help


> I'm helping on the Sage maths project
>
> http://www.sagemath.org/
>
> where there are a large number of packages built, most of which ignore
> CFLAGS.
> (Quite a few ignore CC and CXX too!) I'd like to display all the warnings,
> but
> its hard when people overwrite CFLAGS.
>
> Is there a way I can build gcc such that effectively "-Wall" is enabled
> all the
> time?
>
> If not, could anyone point me to where in the source code I might be able
> to
> hack it, to build a version which displays all the warnings?
>
> I think it would actually be quite a useful option to have when one
> configures gcc!
>
> i.e
>
> configure --prefix=/some/dir --always-display-all-warnings !!!
>

That isn't the only option I'd like to enforce. :-)

Merry Christmas David, you were really awesome and helpful this year. I
certainly hope that I can gain access to that HPUX server of yours again
in the new year and finish off GCC 4.3.4 as a reasonable package.  Maybe
now that it is colder you will have a reason to leave it running longer
and generate heat :-)


-- 
Dennis Clarke
dclarke@opensolaris.ca  <- Email related to the open source Solaris
dclarke@blastwave.org   <- Email related to open source for Solaris


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can I build gcc so -Wall option is always on ?
  2009-12-24 17:01 Can I build gcc so -Wall option is always on ? Dennis Clarke
@ 2009-12-24 21:46 ` Dr. David Kirkby
  0 siblings, 0 replies; 10+ messages in thread
From: Dr. David Kirkby @ 2009-12-24 21:46 UTC (permalink / raw)
  To: dclarke; +Cc: gcc-help

Dennis Clarke wrote:
>> I'm helping on the Sage maths project
>>
>> http://www.sagemath.org/
>>
>> where there are a large number of packages built, most of which ignore
>> CFLAGS.
>> (Quite a few ignore CC and CXX too!) I'd like to display all the warnings,
>> but
>> its hard when people overwrite CFLAGS.
>>
>> Is there a way I can build gcc such that effectively "-Wall" is enabled
>> all the
>> time?
>>
>> If not, could anyone point me to where in the source code I might be able
>> to
>> hack it, to build a version which displays all the warnings?
>>
>> I think it would actually be quite a useful option to have when one
>> configures gcc!
>>
>> i.e
>>
>> configure --prefix=/some/dir --always-display-all-warnings !!!
>>
> 
> That isn't the only option I'd like to enforce. :-)

As a matter of interest, what would be your choice of options to enforce?

It really does annoy me when I see things like this.

g++  -O2 -g -Wa,-W -fno-exceptions -Wno-deprecated  -DINCLUDE_PARI   \
       -I/rootpool2/local/kirkby/sage-4.1.1.alpha0/local/include/pari 
-I/rootpool2/local/kirkby/sage-4.1.1.alpha0/local/include\
       -I ../include/ -L/rootpool2/local/kirkby/sage-4.1.1.alpha0/local/lib \
       cmdline.c \
       Lcommandline.cc Lcommandline_elliptic.cc Lcommandline_globals.cc \
       Lcommandline_misc.cc Lcommandline_numbertheory.cc \
       Lcommandline_twist.cc Lcommandline_values_zeros.cc \
       Lgamma.cc Lglobals.cc Lmisc.cc Lriemannsiegel.cc \
             -o lcalc -lpari -lmpfr -lgmpxx -lgmp -liberty
/usr/ccs/bin/as: error: unknown option 'W'


where someone has tried to add an option to the GNU assembler to suppress 
warnings, but it breaks their code with the Sun assembler. It would have been 
far better to actually fix the cause of warnings.

> Merry Christmas David, you were really awesome and helpful this year. I
> certainly hope that I can gain access to that HPUX server of yours again
> in the new year and finish off GCC 4.3.4 as a reasonable package.  Maybe
> now that it is colder you will have a reason to leave it running longer
> and generate heat :-)
> 
> 

Merry Christmas to you too Dennis.

The HP-UX box is running now, and has been most of the time. I thought I sent 
you an email about it. Feel free to use it. Access is only via ssh now, but 
since port 22 is used for ssh to another machine, I've redirected the external 
port 2022 to this machine. So ssh to port 2022 and you will get to the HP-UX 
machine. I finally got around to installing a server and disabling telnet and 
ftp! Not before time.

BTW, you said you would get me an account on a 1.6 GHz SPARC, but I did not get 
any details.

Dave

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can I build gcc so -Wall option is always on ?
  2010-01-10  7:25         ` Ralf Wildenhues
@ 2010-01-10 10:53           ` Andrew Haley
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Haley @ 2010-01-10 10:53 UTC (permalink / raw)
  To: gcc-help

On 01/10/2010 07:25 AM, Ralf Wildenhues wrote:
> * Joel Dice wrote on Sun, Jan 10, 2010 at 05:24:33AM CET:
>> On Sat, 9 Jan 2010, Joel Dice wrote:
>>>
>>> Try replacing the "$@" in your script with ${1+"$@"}.  That should
>>> ensure "-DPACKAGE_STRING=\"sqlite 3.6.19\"" appears as a single
>>> argument to gcc.real.
> 
> No, ${1+"$@"} only exists to work around a bug in older shells that,
> when no arguments at all were given, wrongly expanded to a single empty
> argument, instead of zero arguments.  That's not relevant here.
> 
> David, post your wrapper script, you have a quoting error elsewhere in
> it.
> 
> Maybe this discussion better belongs on another list; I'm not sure
> where, though.

I'd like it to stay here.  This one gets asked enough that I want
to see a fix for it.  It could be something weird on Solaris, but I
would like to know.

David, simply doing "set -x" in your wrapper script would help.

Andrew.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can I build gcc so -Wall option is always on ?
  2010-01-10  4:24       ` Joel Dice
@ 2010-01-10  7:25         ` Ralf Wildenhues
  2010-01-10 10:53           ` Andrew Haley
  0 siblings, 1 reply; 10+ messages in thread
From: Ralf Wildenhues @ 2010-01-10  7:25 UTC (permalink / raw)
  To: Joel Dice; +Cc: Dr. David Kirkby, gcc-help

* Joel Dice wrote on Sun, Jan 10, 2010 at 05:24:33AM CET:
> On Sat, 9 Jan 2010, Joel Dice wrote:
> >
> >Try replacing the "$@" in your script with ${1+"$@"}.  That should
> >ensure "-DPACKAGE_STRING=\"sqlite 3.6.19\"" appears as a single
> >argument to gcc.real.

No, ${1+"$@"} only exists to work around a bug in older shells that,
when no arguments at all were given, wrongly expanded to a single empty
argument, instead of zero arguments.  That's not relevant here.

David, post your wrapper script, you have a quoting error elsewhere in
it.

Maybe this discussion better belongs on another list; I'm not sure
where, though.

Cheers,
Ralf

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can I build gcc so -Wall option is always on ?
  2010-01-10  2:49     ` Joel Dice
@ 2010-01-10  4:24       ` Joel Dice
  2010-01-10  7:25         ` Ralf Wildenhues
  0 siblings, 1 reply; 10+ messages in thread
From: Joel Dice @ 2010-01-10  4:24 UTC (permalink / raw)
  To: Joel Dice; +Cc: Dr. David Kirkby, Ralf Wildenhues, gcc-help

On Sat, 9 Jan 2010, Joel Dice wrote:

> On Sun, 10 Jan 2010, Dr. David Kirkby wrote:
>
>>  Ralf Wildenhues wrote:
>> >   Hello David,
>> > 
>> >   * Dr. David Kirkby wrote on Thu, Dec 24, 2009 at 05:38:23PM CET:
>> > >   I'm helping on the Sage maths project
>> > > 
>> > >   http://www.sagemath.org/
>> > > 
>> > >   where there are a large number of packages built, most of which 
>> > >   ignore CFLAGS. (Quite a few ignore CC and CXX too!) I'd like to 
>> > >   display all the warnings, but its hard when people overwrite CFLAGS.
>> > > 
>> > >   Is there a way I can build gcc such that effectively "-Wall" is 
>> > >   enabled all the time?
>> > 
>> >   I hate to be stating the obvious, but why not use a wrapper script?
>> > 
>> >   mv gcc gcc.real
>> >   cat >gcc <<\EOF
>> >   #! /bin/sh
>> >   exec gcc.real -Wall "$@"
>> >   EOF
>> > 
>> >   or just put one early in your $PATH.  Depending on your needs, it might
>> >   have to be a bit more complex (put -Wall at the end if you care about
>> >   overriding -Wno-all and some other flags, for example; or only add 
>> >   -Wall
>> >   if -c is also seen, or similarly).
>> > 
>> >   Cheers,
>> >   Ralf
>> >
>>  I've tried this, and it works in 90% of cases, but not all. 'sqlite' is
>>  once such package which always gives errors if I try to build like this.
>>  The errors are like "no newline" or something like that. So I stuck a new
>>  line in, but it still does not work.
>>
>>  Here's one such error, where
>>
>>  make[2]: Entering directory
>>  `/export/home/drkirkby/sage-4.3.1.alpha1/spkg/build/sqlite-3.6.19.p0/src'
>>  if /bin/sh ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"sqlite\"
>>  -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.6.19\"
>>  -DPACKAGE_STRING=\"sqlite\ 3.6.19\"
>>  -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE=\"sqlite\"
>>  -DVERSION=\"3.6.19\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
>>  -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
>>  -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
>>  -DHAVE_DLFCN_H=1 -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1
>>  -DHAVE_GMTIME_R=1 -DHAVE_READLINE=1 -I. -I.   -I
>>  /export/home/drkirkby/sage-4.3.1.alpha1/local/include
>>  -DSQLITE_THREADSAFE=1 -Wall -g -m64 -m64  -g  -O2  -MT sqlite3.lo -MD -MP
>>  -MF ".deps/sqlite3.Tpo" -c -o sqlite3.lo sqlite3.c; \
>>  	then mv -f ".deps/sqlite3.Tpo" ".deps/sqlite3.Plo"; else rm -f
>>  ".deps/sqlite3.Tpo"; exit 1; fi
>>  mkdir .libs
>>  gcc "-DPACKAGE_NAME=\"sqlite\"" "-DPACKAGE_TARNAME=\"sqlite\""
>>  "-DPACKAGE_VERSION=\"3.6.19\"" "-DPACKAGE_STRING=\"sqlite 3.6.19\""
>>  "-DPACKAGE_BUGREPORT=\"http://www.sqlite.org\"" "-DPACKAGE=\"sqlite\""
>>  "-DVERSION=\"3.6.19\"" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
>>  -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
>>  -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
>>  -DHAVE_DLFCN_H=1 -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1
>>  -DHAVE_GMTIME_R=1 -DHAVE_READLINE=1 -I. -I. -I
>>  /export/home/drkirkby/sage-4.3.1.alpha1/local/include
>>  -DSQLITE_THREADSAFE=1 -Wall -g -m64 -m64 -g -O2 -MT sqlite3.lo -MD -MP -MF
>>  .deps/sqlite3.Tpo -c sqlite3.c  -fPIC -DPIC -o .libs/sqlite3.o
>>  gcc: 3.6.19": No such file or directory
>>  make[2]: *** [sqlite3.lo] Error 1
>>  make[2]: Leaving directory
>>  `/export/home/drkirkby/sage-4.3.1.alpha1/spkg/build/sqlite-3.6.19.p0/src'
>>  Error making sqlite
>
> Try replacing the "$@" in your script with ${1+"$@"}.  That should ensure 
> "-DPACKAGE_STRING=\"sqlite 3.6.19\"" appears as a single argument to 
> gcc.real.

Replying to my own suggestion, I'll mention that the ${1+"$@"} syntax is 
something I found in a script written by someone else, and I suggest it 
because I've used it with success in similar situations.

However, despite having studied the man pages for several shells, I have 
never actually figured out what ${1+"$@"} means and how it differs from 
just "$@".  Indeed, the "$@" syntax seems perfectly adequate for this 
case, so I can't explain why Ralf's suggestion isn't working.  I've just 
run a few simple tests, each of which behaves the same regardless of which 
syntax I use, so perhaps they're interchangeable.

Perhaps a shell programming expert can enlighten us.

>>  (The two -m64's are a result of it being added elsewhere too, but
>>  generally I've not found a wrapper suitable.)
>>
>>  Dave
>> 
>> 
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can I build gcc so -Wall option is always on ?
  2010-01-10  0:47   ` Dr. David Kirkby
@ 2010-01-10  2:49     ` Joel Dice
  2010-01-10  4:24       ` Joel Dice
  0 siblings, 1 reply; 10+ messages in thread
From: Joel Dice @ 2010-01-10  2:49 UTC (permalink / raw)
  To: Dr. David Kirkby; +Cc: Ralf Wildenhues, gcc-help

On Sun, 10 Jan 2010, Dr. David Kirkby wrote:

> Ralf Wildenhues wrote:
>>  Hello David,
>>
>>  * Dr. David Kirkby wrote on Thu, Dec 24, 2009 at 05:38:23PM CET:
>> >  I'm helping on the Sage maths project
>> > 
>> >  http://www.sagemath.org/
>> > 
>> >  where there are a large number of packages built, most of which ignore 
>> >  CFLAGS. (Quite a few ignore CC and CXX too!) I'd like to display all the 
>> >  warnings, but its hard when people overwrite CFLAGS.
>> > 
>> >  Is there a way I can build gcc such that effectively "-Wall" is enabled 
>> >  all the time?
>>
>>  I hate to be stating the obvious, but why not use a wrapper script?
>>
>>  mv gcc gcc.real
>>  cat >gcc <<\EOF
>>  #! /bin/sh
>>  exec gcc.real -Wall "$@"
>>  EOF
>>
>>  or just put one early in your $PATH.  Depending on your needs, it might
>>  have to be a bit more complex (put -Wall at the end if you care about
>>  overriding -Wno-all and some other flags, for example; or only add -Wall
>>  if -c is also seen, or similarly).
>>
>>  Cheers,
>>  Ralf
>> 
> I've tried this, and it works in 90% of cases, but not all. 'sqlite' is once 
> such package which always gives errors if I try to build like this. The 
> errors are like "no newline" or something like that. So I stuck a new line 
> in, but it still does not work.
>
> Here's one such error, where
>
> make[2]: Entering directory 
> `/export/home/drkirkby/sage-4.3.1.alpha1/spkg/build/sqlite-3.6.19.p0/src'
> if /bin/sh ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"sqlite\" 
> -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.6.19\" 
> -DPACKAGE_STRING=\"sqlite\ 3.6.19\" 
> -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE=\"sqlite\" 
> -DVERSION=\"3.6.19\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 
> -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 
> -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 
> -DHAVE_DLFCN_H=1 -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 
> -DHAVE_GMTIME_R=1 -DHAVE_READLINE=1 -I. -I.   -I 
> /export/home/drkirkby/sage-4.3.1.alpha1/local/include -DSQLITE_THREADSAFE=1 
> -Wall -g -m64 -m64  -g  -O2  -MT sqlite3.lo -MD -MP -MF ".deps/sqlite3.Tpo" 
> -c -o sqlite3.lo sqlite3.c; \
> 	then mv -f ".deps/sqlite3.Tpo" ".deps/sqlite3.Plo"; else rm -f 
> ".deps/sqlite3.Tpo"; exit 1; fi
> mkdir .libs
> gcc "-DPACKAGE_NAME=\"sqlite\"" "-DPACKAGE_TARNAME=\"sqlite\"" 
> "-DPACKAGE_VERSION=\"3.6.19\"" "-DPACKAGE_STRING=\"sqlite 3.6.19\"" 
> "-DPACKAGE_BUGREPORT=\"http://www.sqlite.org\"" "-DPACKAGE=\"sqlite\"" 
> "-DVERSION=\"3.6.19\"" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 
> -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 
> -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 
> -DHAVE_DLFCN_H=1 -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 
> -DHAVE_GMTIME_R=1 -DHAVE_READLINE=1 -I. -I. -I 
> /export/home/drkirkby/sage-4.3.1.alpha1/local/include -DSQLITE_THREADSAFE=1 
> -Wall -g -m64 -m64 -g -O2 -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c 
> sqlite3.c  -fPIC -DPIC -o .libs/sqlite3.o
> gcc: 3.6.19": No such file or directory
> make[2]: *** [sqlite3.lo] Error 1
> make[2]: Leaving directory 
> `/export/home/drkirkby/sage-4.3.1.alpha1/spkg/build/sqlite-3.6.19.p0/src'
> Error making sqlite

Try replacing the "$@" in your script with ${1+"$@"}.  That should ensure 
"-DPACKAGE_STRING=\"sqlite 3.6.19\"" appears as a single argument to 
gcc.real.

> (The two -m64's are a result of it being added elsewhere too, but generally 
> I've not found a wrapper suitable.)
>
> Dave
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can I build gcc so -Wall option is always on ?
  2009-12-30 21:41 ` Ralf Wildenhues
@ 2010-01-10  0:47   ` Dr. David Kirkby
  2010-01-10  2:49     ` Joel Dice
  0 siblings, 1 reply; 10+ messages in thread
From: Dr. David Kirkby @ 2010-01-10  0:47 UTC (permalink / raw)
  To: Ralf Wildenhues, Dr. David Kirkby, gcc-help

Ralf Wildenhues wrote:
> Hello David,
> 
> * Dr. David Kirkby wrote on Thu, Dec 24, 2009 at 05:38:23PM CET:
>> I'm helping on the Sage maths project
>>
>> http://www.sagemath.org/
>>
>> where there are a large number of packages built, most of which ignore 
>> CFLAGS. (Quite a few ignore CC and CXX too!) I'd like to display all the 
>> warnings, but its hard when people overwrite CFLAGS.
>>
>> Is there a way I can build gcc such that effectively "-Wall" is enabled 
>> all the time?
> 
> I hate to be stating the obvious, but why not use a wrapper script?
> 
> mv gcc gcc.real
> cat >gcc <<\EOF
> #! /bin/sh
> exec gcc.real -Wall "$@"
> EOF
> 
> or just put one early in your $PATH.  Depending on your needs, it might
> have to be a bit more complex (put -Wall at the end if you care about
> overriding -Wno-all and some other flags, for example; or only add -Wall
> if -c is also seen, or similarly).
> 
> Cheers,
> Ralf
> 
I've tried this, and it works in 90% of cases, but not all. 'sqlite' is once 
such package which always gives errors if I try to build like this. The errors 
are like "no newline" or something like that. So I stuck a new line in, but it 
still does not work.

Here's one such error, where

make[2]: Entering directory 
`/export/home/drkirkby/sage-4.3.1.alpha1/spkg/build/sqlite-3.6.19.p0/src'
if /bin/sh ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"sqlite\" 
-DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.6.19\" 
-DPACKAGE_STRING=\"sqlite\ 3.6.19\" 
-DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE=\"sqlite\" 
-DVERSION=\"3.6.19\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 
-DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 
-DHAVE_READLINE=1 -I. -I.   -I 
/export/home/drkirkby/sage-4.3.1.alpha1/local/include -DSQLITE_THREADSAFE=1 
-Wall -g -m64 -m64  -g  -O2  -MT sqlite3.lo -MD -MP -MF ".deps/sqlite3.Tpo" -c 
-o sqlite3.lo sqlite3.c; \
	then mv -f ".deps/sqlite3.Tpo" ".deps/sqlite3.Plo"; else rm -f 
".deps/sqlite3.Tpo"; exit 1; fi
mkdir .libs
  gcc "-DPACKAGE_NAME=\"sqlite\"" "-DPACKAGE_TARNAME=\"sqlite\"" 
"-DPACKAGE_VERSION=\"3.6.19\"" "-DPACKAGE_STRING=\"sqlite 3.6.19\"" 
"-DPACKAGE_BUGREPORT=\"http://www.sqlite.org\"" "-DPACKAGE=\"sqlite\"" 
"-DVERSION=\"3.6.19\"" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 
-DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 
-DHAVE_READLINE=1 -I. -I. -I 
/export/home/drkirkby/sage-4.3.1.alpha1/local/include -DSQLITE_THREADSAFE=1 
-Wall -g -m64 -m64 -g -O2 -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c 
sqlite3.c  -fPIC -DPIC -o .libs/sqlite3.o
gcc: 3.6.19": No such file or directory
make[2]: *** [sqlite3.lo] Error 1
make[2]: Leaving directory 
`/export/home/drkirkby/sage-4.3.1.alpha1/spkg/build/sqlite-3.6.19.p0/src'
Error making sqlite

(The two -m64's are a result of it being added elsewhere too, but generally I've 
not found a wrapper suitable.)

Dave

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can I build gcc so -Wall option is always on ?
  2009-12-24 16:42 Dr. David Kirkby
  2009-12-25 14:56 ` Andi Hellmund
@ 2009-12-30 21:41 ` Ralf Wildenhues
  2010-01-10  0:47   ` Dr. David Kirkby
  1 sibling, 1 reply; 10+ messages in thread
From: Ralf Wildenhues @ 2009-12-30 21:41 UTC (permalink / raw)
  To: Dr. David Kirkby; +Cc: gcc-help

Hello David,

* Dr. David Kirkby wrote on Thu, Dec 24, 2009 at 05:38:23PM CET:
> I'm helping on the Sage maths project
>
> http://www.sagemath.org/
>
> where there are a large number of packages built, most of which ignore 
> CFLAGS. (Quite a few ignore CC and CXX too!) I'd like to display all the 
> warnings, but its hard when people overwrite CFLAGS.
>
> Is there a way I can build gcc such that effectively "-Wall" is enabled 
> all the time?

I hate to be stating the obvious, but why not use a wrapper script?

mv gcc gcc.real
cat >gcc <<\EOF
#! /bin/sh
exec gcc.real -Wall "$@"
EOF

or just put one early in your $PATH.  Depending on your needs, it might
have to be a bit more complex (put -Wall at the end if you care about
overriding -Wno-all and some other flags, for example; or only add -Wall
if -c is also seen, or similarly).

Cheers,
Ralf

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can I build gcc so -Wall option is always on ?
  2009-12-24 16:42 Dr. David Kirkby
@ 2009-12-25 14:56 ` Andi Hellmund
  2009-12-30 21:41 ` Ralf Wildenhues
  1 sibling, 0 replies; 10+ messages in thread
From: Andi Hellmund @ 2009-12-25 14:56 UTC (permalink / raw)
  To: Dr. David Kirkby; +Cc: gcc-help

Hey David,

On Thu, 24 Dec 2009, Dr. David Kirkby wrote:
> I'm helping on the Sage maths project
>
> http://www.sagemath.org/
>
> where there are a large number of packages built, most of which ignore 
> CFLAGS. (Quite a few ignore CC and CXX too!) I'd like to display all the 
> warnings, but its hard when people overwrite CFLAGS.
>
> Is there a way I can build gcc such that effectively "-Wall" is enabled all 
> the time?
> If not, could anyone point me to where in the source code I might be able to 
> hack it, to build a version which displays all the warnings?

I doubt that you can configure gcc to enable all warnings by default, but 
I'm not 100% sure, but you could possibly use one of the following 
possiblities to hack it into gcc:

1) For C/C++ code, the function 'c_common_handle_option' sets all the 
single warnings covered/enabled by -Wall. For gcc-4.4.1, it's 
c-opts.c:378. So, to always enable -Wall, you could call 
c_common_handle_option (via the language hooks) in 
decode_options after parsing of the command-line parameters is finished. I 
didn't test it, but you should get the effect of -Wall by calling 
c_common_handle_option(OPT_Wall, NULL, true);

2) As an alternative, you could change the gcc driver to always pass -Wall 
to the compiler (cc1,cc1plus). For this, please check,

gcc.c:827 --> cc1_options

If I see it correctly, this should then work for C/C++ compilations.

I hope that is what you're searching for ...

Happy X-Mas,

- Andi -



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Can I build gcc so -Wall option is always on ?
@ 2009-12-24 16:42 Dr. David Kirkby
  2009-12-25 14:56 ` Andi Hellmund
  2009-12-30 21:41 ` Ralf Wildenhues
  0 siblings, 2 replies; 10+ messages in thread
From: Dr. David Kirkby @ 2009-12-24 16:42 UTC (permalink / raw)
  To: gcc-help

I'm helping on the Sage maths project

http://www.sagemath.org/

where there are a large number of packages built, most of which ignore CFLAGS. 
(Quite a few ignore CC and CXX too!) I'd like to display all the warnings, but 
its hard when people overwrite CFLAGS.

Is there a way I can build gcc such that effectively "-Wall" is enabled all the 
time?

If not, could anyone point me to where in the source code I might be able to 
hack it, to build a version which displays all the warnings?

I think it would actually be quite a useful option to have when one configures gcc!

i.e

configure --prefix=/some/dir --always-display-all-warnings !!!


Dave

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-01-10 10:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-24 17:01 Can I build gcc so -Wall option is always on ? Dennis Clarke
2009-12-24 21:46 ` Dr. David Kirkby
  -- strict thread matches above, loose matches on Subject: below --
2009-12-24 16:42 Dr. David Kirkby
2009-12-25 14:56 ` Andi Hellmund
2009-12-30 21:41 ` Ralf Wildenhues
2010-01-10  0:47   ` Dr. David Kirkby
2010-01-10  2:49     ` Joel Dice
2010-01-10  4:24       ` Joel Dice
2010-01-10  7:25         ` Ralf Wildenhues
2010-01-10 10:53           ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).