This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFC: -Wstrict-overflow, take 2
On 2/14/07, Richard Guenther <richard.guenther@gmail.com> wrote:
On 13 Feb 2007 14:35:16 -0800, Ian Lance Taylor <iant@google.com> wrote:
> Ian Lance Taylor <iant@google.com> writes:
>
> > Here is a new version of my -Wstrict-overflow patch. This
> > incorporates all the comments made on the first version.
>
> I have committed this patch.
something goes wrong:
gcc -g -fkeep-inline-functions -DIN_GCC -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute
-fno-common -DHAVE_CONFIG_H -o xgcc gcc.o opts-common.o
gcc-options.o gccspec.o \
intl.o prefix.o version.o driver-i386.o ../libcpp/libcpp.a
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lmpfr -lgmp
gcc.o: In function `issue_strict_overflow_warning':
../../gcc/gcc/flags.h:342: undefined reference to `warn_strict_overflow'
collect2: ld returned 1 exit status
make[3]: *** [xgcc] Error 1
I guess the -fkeep-inline-functions is the culprit (the code seems to rely on
flags.h:issue_strict_overflow_warning function being removed). Bootstrap
compiler is gcc 3.3.3-hammer for me.
Fixed by the following, bootstrapped and tested on x86_64-unknown-linux-gnu
using gcc 3.3 as bootstrap compiler.
Richard.
2007-02-14 Richard Guenther <rguenther@suse.de>
* flags.h (issue_strict_overflow_warning): Convert to a macro.
2007-02-14 Richard Guenther <rguenther@suse.de>
* flags.h (issue_strict_overflow_warning): Convert to a macro.
Index: flags.h
===================================================================
*** flags.h (revision 121944)
--- flags.h (working copy)
*************** enum warn_strict_overflow_code
*** 335,345 ****
};
/* Whether to emit an overflow warning whose code is C. */
!
! static inline bool
! issue_strict_overflow_warning (enum warn_strict_overflow_code c)
! {
! return warn_strict_overflow >= (int) c;
! }
#endif /* ! GCC_FLAGS_H */
--- 335,340 ----
};
/* Whether to emit an overflow warning whose code is C. */
! #define issue_strict_overflow_warning(c) (warn_strict_overflow >= (int) (c))
#endif /* ! GCC_FLAGS_H */