SUPERCEDES 21.5
"Stephen J. Turnbull" <stephen(a)xemacs.org> wrote:
I don't see a good reason to use the $((expr))syntax instead of
ordinary variable substitution. All of zsh 4.2.5, (Debian) ash
0.5.3-3, and bash 3.1.14(1)-release work with 'test "$__GCC" -ge 3'
for numerical values of __GCC. The conf programs presumably are
guaranteed to give numerical output for any usable version of gcc,
right?
Sorry, I was just having a brain cramp in public. I tried
'test $__GCC -ge 3' (i.e., without the quotes around $__GCC) and when
that didn't work, I got the $(()) stuff out of the bash manual.
Oooooookay, time for me to go home and rest for awhile, isn't it?
I'm including a superceding patch below. I'm concerned though, because
a test run of configure produced a top-level Makefile that shows this:
CFLAGS=-Wall -Wno-switch -Wundef -Wsign-compare -Wno-char-subscripts -Wpacked
-Wdeclaration-after-statement -Wshadow -Wmissing-declarations -Wmissing-prototypes
-Wstrict-prototypes -g -O2
but the Installation file contains this line:
- Compiler command: gcc -Wall -Wno-switch -Wundef -Wsign-compare
-Wno-char-subscripts -Wpacked -Wunused-parameter -g -O2
which matches the CFLAGS setting in src/Makefile. Why is the top-level
Makefile different from src/Makefile in the setting of CFLAGS? Since
it's only mentioned in the top-level Makefile, am I really going to get
-Wdeclaration-after-statement? (Time passes while a quick test is
performed.)
No! I'm only getting -Wdeclaration-after-statement while compiling in
lib-src. The compilation in lwlib and src uses the CFLAGS reported in
Installation. What's going on here?
Index: configure.ac
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.ac,v
retrieving revision 1.43
diff -d -u -r1.43 configure.ac
--- configure.ac 2006/06/06 00:18:29 1.43
+++ configure.ac 2006/06/22 00:04:55
@@ -1883,15 +1883,13 @@
dnl Determine GCC version.
if test "$GCC" = "yes"; then
AC_RUN_IFELSE([AC_LANG_SOURCE([int main () {
-#if __GNUC__ >= 3
-return 11;
-#else
-return 0;
-#endif
-}])], [:],
-[case "$?" in
- 11) echo "You appear to be using GCC version 3 or above."; __GCC3=yes ;;
-esac])
+return __GNUC__;
+}])], [:], [__GCC="$?"])
+AC_RUN_IFELSE([AC_LANG_SOURCE([int main () {
+return __GNUC_MINOR__;
+}])], [:], [__GCC_MINOR="$?"])
+__GCC_VERSION=$__GCC"."$__GCC_MINOR
+echo "You appear to be using GCC version" $__GCC_VERSION
fi
dnl Support for using a different compiler for xemacs itself.
@@ -2311,7 +2309,7 @@
dnl Warnings about char subscripts are pretty pointless, though,
dnl and we use them in various places.
with_cflags_warning="$with_cflags_warning -Wsign-compare
-Wno-char-subscripts"
- test "$__GCC3" = "yes" &&
with_cflags_warning="$with_cflags_warning -Wpacked"
+ test "$__GCC" -ge 3 &&
with_cflags_warning="$with_cflags_warning -Wpacked"
dnl glibc is intentionally not `-Wpointer-arith'-clean.
dnl Ulrich Drepper has rejected patches to fix the glibc header files.
test "$have_glibc" != "yes" && \
@@ -2327,8 +2325,11 @@
dnl some very ugly code changes.
if test "$with_xemacs_compiler" = "g++"; then
xe_cflags_warning="$with_cflags_warning -Weffc++"
- elif test "$__GCC3" = "yes"; then
+ elif test "$__GCC" -ge 3; then
xe_cflags_warning="$with_cflags_warning -Wunused-parameter"
+ if test "$__GCC" -gt 3 || test "$__GCC_MINOR" -ge 4; then
+ with_cflags_warning="$with_cflags_warning
-Wdeclaration-after-statement"
+ fi
fi
with_cflags_warning="$with_cflags_warning -Wshadow -Wmissing-declarations"
with_cflags_warning="$with_cflags_warning -Wmissing-prototypes
-Wstrict-prototypes"
--
Jerry James, Assistant Professor james(a)xemacs.org
Computer Science Department
http://www.cs.usu.edu/~jerry/
Utah State University