bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiling 1.7.0 with gcc-3.3


From: Mikael Djurfeldt
Subject: Compiling 1.7.0 with gcc-3.3
Date: Mon, 19 May 2003 12:09:53 +0200

I've tried to compile CVS HEAD (1.7.0) with gcc-3.3.

Of course, I'd like this to work with the default
--enable-error-on-warning.  However, there are two problematic
instances.  One is the use of SCM_STACKITEM.  For example:

eval.c:1965:
  if (scm_stack_checking_enabled_p
      && SCM_STACK_OVERFLOW_P ((SCM_STACKITEM *) &proc))

The cast into (SCM_STACKITEM *) causes a warning that the pointer can
cause errors due to aliasing optimizations if it is dereferenced
(which it isn't, BTW).  -fstrict-aliasing is turned on by -O2 in
gcc-3.3.

This could be "solved" by adding -Wno-strict-aliasing to the
compilation options, but that might remove better motivated warnings.

Another problem seems more difficult:

gcc -DHAVE_CONFIG_H -I. -I../../../guile-core-new/libguile -I.. -I.. 
-I../../../guile-core-new -I../../../guile-core-new/libguile-ltdl -g -O2 
-Werror -Wall -Wmissing-prototypes -Wno-strict-aliasing -MT numbers.lo -MD -MP 
-MF .deps/numbers.Tpo -c ../../../guile-core-new/libguile/numbers.c  -fPIC 
-DPIC -o .libs/numbers.lo
In file included from ../../../guile-core-new/libguile/numbers.c:4084:
../../../guile-core-new/libguile/num2integral.i.c: In function 
`scm_num2long_long':
../../../guile-core-new/libguile/num2integral.i.c:65: warning: comparison is 
always false due to limited range of data type
In file included from ../../../guile-core-new/libguile/numbers.c:4092:
../../../guile-core-new/libguile/num2integral.i.c: In function 
`scm_num2ulong_long':
../../../guile-core-new/libguile/num2integral.i.c:65: warning: comparison is 
always false due to limited range of data type

I think this is a stupid warning message.  In any case, you'd want to
be able to shut it off.  I can't find any way to do that.  Maybe we
should talk to the gcc people about this?

I've tried to enclose the code causing the warning with a surrounding
conditional which tests the sizes of the data types, but the compiler
outputs the above warning even though the code isn't going to be
compiled.

I think it's important to resolve this in some way.  If we can't, I'm
going to suggest that we shut off error-on-warning as a default, which
would be sad.  But Guile should compile "out-of-the-box".

Mikael




reply via email to

[Prev in Thread] Current Thread [Next in Thread]