From unknown Tue Jun 17 20:08:21 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#11207 <11207@debbugs.gnu.org> To: bug#11207 <11207@debbugs.gnu.org> Subject: Status: configure: new option --enable-gcc-warnings Reply-To: bug#11207 <11207@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:08:21 +0000 retitle 11207 configure: new option --enable-gcc-warnings reassign 11207 emacs submitter 11207 Paul Eggert severity 11207 wishlist tag 11207 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 09 03:59:24 2012 Received: (at submit) by debbugs.gnu.org; 9 Apr 2012 07:59:24 +0000 Received: from localhost ([127.0.0.1]:46131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SH9VS-0006wT-3o for submit@debbugs.gnu.org; Mon, 09 Apr 2012 03:59:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43969) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SH9VN-0006wK-VN for submit@debbugs.gnu.org; Mon, 09 Apr 2012 03:59:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SH9US-0006Vw-Ar for submit@debbugs.gnu.org; Mon, 09 Apr 2012 03:58:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:52126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SH9US-0006Vq-7Y for submit@debbugs.gnu.org; Mon, 09 Apr 2012 03:58:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SH9UO-0004SU-Rd for bug-gnu-emacs@gnu.org; Mon, 09 Apr 2012 03:58:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SH9UK-0006V5-LR for bug-gnu-emacs@gnu.org; Mon, 09 Apr 2012 03:58:16 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:55877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SH9UK-0006UL-7X for bug-gnu-emacs@gnu.org; Mon, 09 Apr 2012 03:58:12 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id A7259A60003 for ; Mon, 9 Apr 2012 00:58:02 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jCNaB8LewDoC for ; Mon, 9 Apr 2012 00:58:00 -0700 (PDT) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 845DBA60001 for ; Mon, 9 Apr 2012 00:58:00 -0700 (PDT) Message-ID: <4F829688.6080602@cs.ucla.edu> Date: Mon, 09 Apr 2012 00:58:00 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: configure: new option --enable-gcc-warnings Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Package: emacs Version: 24.1 Tags: patch Here's a patch to add a 'configure' option --enable-gcc-warnings that enables GCC static checking options that I've found useful for checking Emacs. It uses code borrowed from GNU coreutils, which has this option in its 'configure' script. I've been using this for many months to find bugs in Emacs, and it's mature enough to publish now. I'd like to install it into the trunk at an appropriate time. # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: eggert@cs.ucla.edu-20120409074559-3m1t6s9bhkz1cb62 # target_branch: bzr+ssh://eggert@bzr.savannah.gnu.org/emacs/trunk # testament_sha1: 5a97b04aaf25a2e78f8bd8320c615579bbd78566 # timestamp: 2012-04-09 00:46:35 -0700 # base_revision_id: eggert@cs.ucla.edu-20120409065240-02ros2knvxqadia4 # # Begin patch === modified file 'ChangeLog' --- ChangeLog 2012-04-09 06:40:20 +0000 +++ ChangeLog 2012-04-09 07:45:59 +0000 @@ -1,3 +1,20 @@ +2012-04-09 Paul Eggert + + configure: new option --enable-gcc-warnings + I have been using this change for many months in my private copy + of Emacs, and have used it to find several bugs. It's mature + enough to publish now. + * Makefile.in (GNULIB_MODULES): Add warnings, manywarnings. + * configure.in: Support --enable-gcc-warnings, in the style of + other GNU packages such as coreutils. + (C_WARNINGS_SWITCH): Remove, replacing with... + (WARN_CFLAGS, GNULIB_WARN_CFLAGS): New variable. + (PKG_CHECK_MODULES, C_SWITCH_X_SITE): Use -isystem rather than -I, + when including system files with GCC. + * etc/NEWS: Mention --enable-gcc-warnings. + * lib/Makefile.am (AM_CFLAGS): New macro. + * m4/manywarnings.m4, m4/warnings.m4: New files, from gnulib. + 2012-04-09 Glenn Morris * Makefile.in (leim): Check cd return value. Pass fewer variables. === modified file 'Makefile.in' --- Makefile.in 2012-04-09 06:40:20 +0000 +++ Makefile.in 2012-04-09 07:45:59 +0000 @@ -336,8 +336,9 @@ careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr \ dup2 \ filemode getloadavg getopt-gnu ignore-value intprops lstat \ - mktime pthread_sigmask readlink \ - socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat + manywarnings mktime pthread_sigmask readlink \ + socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat \ + warnings GNULIB_TOOL_FLAGS = \ --avoid=msvc-inval --avoid=msvc-nothrow \ --avoid=raise --avoid=threadlib \ === modified file 'configure.in' --- configure.in 2012-04-09 00:50:17 +0000 +++ configure.in 2012-04-09 07:45:59 +0000 @@ -686,47 +686,121 @@ test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS" fi -### Use -Wdeclaration-after-statement if the compiler supports it -AC_MSG_CHECKING([whether gcc understands -Wdeclaration-after-statement]) -SAVE_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wdeclaration-after-statement" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], has_option=yes, has_option=no) -if test $has_option = yes; then - C_WARNINGS_SWITCH="-Wdeclaration-after-statement $C_WARNINGS_SWITCH" -fi -AC_MSG_RESULT($has_option) -CFLAGS="$SAVE_CFLAGS" -unset has_option -unset SAVE_CFLAGS - -### Use -Wold-style-definition if the compiler supports it -# This can be removed when conversion to standard C is finished. -AC_MSG_CHECKING([whether gcc understands -Wold-style-definition]) -SAVE_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wold-style-definition" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], has_option=yes, has_option=no) -if test $has_option = yes; then - C_WARNINGS_SWITCH="-Wold-style-definition $C_WARNINGS_SWITCH" -fi -AC_MSG_RESULT($has_option) -CFLAGS="$SAVE_CFLAGS" -unset has_option -unset SAVE_CFLAGS - -### Use -Wimplicit-function-declaration if the compiler supports it -AC_MSG_CHECKING([whether gcc understands -Wimplicit-function-declaration]) -SAVE_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wimplicit-function-declaration" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], has_option=yes, has_option=no) -if test $has_option = yes; then - C_WARNINGS_SWITCH="-Wimplicit-function-declaration $C_WARNINGS_SWITCH" -fi -AC_MSG_RESULT($has_option) -CFLAGS="$SAVE_CFLAGS" -unset has_option -unset SAVE_CFLAGS - -AC_SUBST(C_WARNINGS_SWITCH) +AC_ARG_ENABLE([gcc-warnings], + [AS_HELP_STRING([--enable-gcc-warnings], + [turn on lots of GCC warnings (for developers)])], + [case $enableval in + yes|no) ;; + *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;; + esac + gl_gcc_warnings=$enableval], + [gl_gcc_warnings=no] +) + +# gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found]) +# ------------------------------------------------ +# If $CPP is gcc-MAJOR.MINOR or newer, then run RUN-IF-FOUND. +# Otherwise, run RUN-IF-NOT-FOUND. +AC_DEFUN([gl_GCC_VERSION_IFELSE], + [AC_PREPROC_IFELSE( + [AC_LANG_PROGRAM( + [[ +#if ($1) < __GNUC__ || (($1) == __GNUC__ && ($2) <= __GNUC_MINOR__) +/* ok */ +#else +# error "your version of gcc is older than $1.$2" +#endif + ]]), + ], [$3], [$4]) + ] +) + +# When compiling with GCC, prefer -isystem to -I when including system +# include files, to avoid generating useless diagnostics for the files. +if test "$gl_gcc_warnings" != yes; then + isystem='-I' +else + isystem='-isystem ' + + # This, $nw, is the list of warnings we disable. + nw= + + case $with_x_toolkit in + lucid | athena | motif) + # Old toolkits mishandle 'const'. + nw="$nw -Wwrite-strings" + ;; + *) + gl_WARN_ADD([-Werror], [WERROR_CFLAGS]) + ;; + esac + AC_SUBST([WERROR_CFLAGS]) + + nw="$nw -Waggregate-return" # anachronistic + nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h) + nw="$nw -Wc++-compat" # We don't care about C++ compilers + nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib + nw="$nw -Wtraditional" # Warns on #elif which we use often + nw="$nw -Wcast-qual" # Too many warnings for now + nw="$nw -Wconversion" # Too many warnings for now + nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings + nw="$nw -Wsign-conversion" # Too many warnings for now + nw="$nw -Woverlength-strings" # Not a problem these days + nw="$nw -Wtraditional-conversion" # Too many warnings for now + nw="$nw -Wpadded" # Our structs are not padded + nw="$nw -Wredundant-decls" # We regularly (re)declare getenv etc. + nw="$nw -Wlogical-op" # any use of fwrite provokes this + nw="$nw -Wformat-nonliteral" # Emacs does this a lot + nw="$nw -Wvla" # warnings in gettext.h + nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__ + nw="$nw -Wswitch-enum" # Too many warnings for now + nw="$nw -Wswitch-default" # Too many warnings for now + nw="$nw -Wfloat-equal" # e.g., ftoastr.c + nw="$nw -Winline" # e.g., dispnew.c's inlining of row_equal_p + + # Emacs doesn't care about shadowing; see + # . + nw="$nw -Wshadow" + + # The following lines should be removable at some point. + nw="$nw -Wsuggest-attribute=const" + nw="$nw -Wsuggest-attribute=pure" + + gl_MANYWARN_ALL_GCC([ws]) + gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw]) + for w in $ws; do + gl_WARN_ADD([$w]) + done + gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one + gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now + gl_WARN_ADD([-Wno-type-limits]) # Too many warnings for now + gl_WARN_ADD([-Wno-switch]) # Too many warnings for now + gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now + gl_WARN_ADD([-Wno-format-nonliteral]) + + # In spite of excluding -Wlogical-op above, it is enabled, as of + # gcc 4.5.0 20090517. + gl_WARN_ADD([-Wno-logical-op]) + + gl_WARN_ADD([-fdiagnostics-show-option]) + gl_WARN_ADD([-funit-at-a-time]) + + AC_SUBST([WARN_CFLAGS]) + + AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.]) + AC_DEFINE([_FORTIFY_SOURCE], [2], + [enable compile-time and run-time bounds-checking, and some warnings]) + AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks]) + + # We use a slightly smaller set of warning options for lib/. + # Remove the following and save the result in GNULIB_WARN_CFLAGS. + nw= + nw="$nw -Wunused-macros" + + gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw]) + AC_SUBST([GNULIB_WARN_CFLAGS]) +fi + #### Some other nice autoconf tests. @@ -1127,8 +1201,13 @@ if $PKG_CONFIG --exists "$2" 2>&AS_MESSAGE_LOG_FD && $1_CFLAGS=`$PKG_CONFIG --cflags "$2" 2>&AS_MESSAGE_LOG_FD` && $1_LIBS=`$PKG_CONFIG --libs "$2" 2>&AS_MESSAGE_LOG_FD`; then - - $1_CFLAGS=`AS_ECHO(["$$1_CFLAGS"]) | sed -e 's,///*,/,g'` + edit_cflags=" + s,///*,/,g + s/^/ / + s/ -I/ $isystem/g + s/^ // + " + $1_CFLAGS=`AS_ECHO(["$$1_CFLAGS"]) | sed -e "$edit_cflags"` $1_LIBS=`AS_ECHO(["$$1_LIBS"]) | sed -e 's,///*,/,g'` AC_MSG_RESULT([yes CFLAGS='$$1_CFLAGS' LIBS='$$1_LIBS']) succeeded=yes @@ -1463,7 +1542,7 @@ AC_SUBST(LD_SWITCH_X_SITE_AUX_RPATH) if test "${x_includes}" != NONE && test -n "${x_includes}"; then - C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"` + C_SWITCH_X_SITE="$isystem"`echo ${x_includes} | sed -e "s/:/ $isystem/g"` fi if test x"${x_includes}" = x; then === modified file 'etc/NEWS' --- etc/NEWS 2012-04-07 19:51:51 +0000 +++ etc/NEWS 2012-04-09 07:45:59 +0000 @@ -22,6 +22,13 @@ * Installation Changes in Emacs 24.2 + +** New configure option '--enable-gcc-warnings', intended for developers. +If building with GCC, this enables compile-time checks that warn about +possibly-questionable C code. On a recent GNU system there should be +no warnings; on older and on non-GNU systems the generated warnings +may or may not be useful. By default, these warnings are not generated. + * Startup Changes in Emacs 24.2 === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-04-07 13:57:36 +0000 +++ lib-src/ChangeLog 2012-04-09 07:45:59 +0000 @@ -1,3 +1,10 @@ +2012-04-09 Paul Eggert + + configure: new option --enable-gcc-warnings + * Makefile.in (C_WARNINGS_SWITCH): Remove. + (WARN_CFLAGS, WERROR_CFLAGS): New macros. + (BASE_CFLAGS): Use new macros rather than old. + 2012-04-07 Eli Zaretskii * makefile.w32-in (obj): Add xml.o. === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2012-01-19 07:21:25 +0000 +++ lib-src/Makefile.in 2012-04-09 07:45:59 +0000 @@ -36,8 +36,9 @@ EXEEXT=@EXEEXT@ C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ -C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@ PROFILING_CFLAGS = @PROFILING_CFLAGS@ +WARN_CFLAGS = @WARN_CFLAGS@ +WERROR_CFLAGS = @WERROR_CFLAGS@ # Program name transformation. TRANSFORM = @program_transform_name@ @@ -167,7 +168,8 @@ # Those files shared with other GNU utilities need HAVE_CONFIG_H # defined before they know they can take advantage of the information # in ../src/config.h. -BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) ${C_WARNINGS_SWITCH} \ +BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \ + $(WARN_CFLAGS) $(WERROR_CFLAGS) \ -DHAVE_CONFIG_H -I. -I../src -I../lib \ -I${srcdir} -I${srcdir}/../src -I${srcdir}/../lib === modified file 'lib/Makefile.am' --- lib/Makefile.am 2011-02-20 10:51:50 +0000 +++ lib/Makefile.am 2012-04-09 07:45:59 +0000 @@ -4,6 +4,7 @@ MOSTLYCLEANFILES = noinst_LIBRARIES = +AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src include gnulib.mk === modified file 'lwlib/ChangeLog' --- lwlib/ChangeLog 2012-02-09 07:48:22 +0000 +++ lwlib/ChangeLog 2012-04-09 07:45:59 +0000 @@ -1,3 +1,10 @@ +2012-04-09 Paul Eggert + + configure: new option --enable-gcc-warnings + * Makefile.in (C_WARNINGS_SWITCH): Remove. + (WARN_CFLAGS, WERROR_CFLAGS): New macros. + (ALL_CFLAGS): Use new macros rather than old. + 2011-10-13 Dmitry Antipov * lwlib-Xaw.c (openFont, xaw_destroy_instance): Replace free with === modified file 'lwlib/Makefile.in' --- lwlib/Makefile.in 2012-01-19 07:21:25 +0000 +++ lwlib/Makefile.in 2012-04-09 07:45:59 +0000 @@ -29,8 +29,9 @@ C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@ C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ -C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@ PROFILING_CFLAGS = @PROFILING_CFLAGS@ +WARN_CFLAGS = `echo @WARN_CFLAGS@ | sed 's/ -Wwrite-strings//'` +WERROR_CFLAGS = @WERROR_CFLAGS@ CC=@CC@ CFLAGS=@CFLAGS@ @@ -54,7 +55,8 @@ ## There are no generated lwlib files, hence no need for -I. ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ $(C_SWITCH_X_SYSTEM) $(C_SWITCH_MACHINE) \ - $(C_WARNINGS_SWITCH) $(PROFILING_CFLAGS) $(CFLAGS) \ + $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(PROFILING_CFLAGS) $(CFLAGS) \ -DHAVE_CONFIG_H -Demacs -I../src \ -I$(srcdir) -I$(srcdir)/../src -I../lib -I$(srcdir)/../lib === added file 'm4/manywarnings.m4' --- m4/manywarnings.m4 1970-01-01 00:00:00 +0000 +++ m4/manywarnings.m4 2012-04-09 07:45:59 +0000 @@ -0,0 +1,184 @@ +# manywarnings.m4 serial 3 +dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Simon Josefsson + +# gl_MANYWARN_COMPLEMENT(OUTVAR, LISTVAR, REMOVEVAR) +# -------------------------------------------------- +# Copy LISTVAR to OUTVAR except for the entries in REMOVEVAR. +# Elements separated by whitespace. In set logic terms, the function +# does OUTVAR = LISTVAR \ REMOVEVAR. +AC_DEFUN([gl_MANYWARN_COMPLEMENT], +[ + gl_warn_set= + set x $2; shift + for gl_warn_item + do + case " $3 " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + $1=$gl_warn_set +]) + +# gl_MANYWARN_ALL_GCC(VARIABLE) +# ----------------------------- +# Add all documented GCC warning parameters to variable VARIABLE. +# Note that you need to test them using gl_WARN_ADD if you want to +# make sure your gcc understands it. +AC_DEFUN([gl_MANYWARN_ALL_GCC], +[ + dnl First, check if -Wno-missing-field-initializers is needed. + dnl -Wmissing-field-initializers is implied by -W, but that issues + dnl warnings with GCC version before 4.7, for the common idiom + dnl of initializing types on the stack to zero, using { 0, } + AC_REQUIRE([AC_PROG_CC]) + if test -n "$GCC"; then + + dnl First, check -W -Werror -Wno-missing-field-initializers is supported + dnl with the current $CC $CFLAGS $CPPFLAGS. + AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported]) + AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [gl_cv_cc_nomfi_supported=yes], + [gl_cv_cc_nomfi_supported=no]) + CFLAGS="$gl_save_CFLAGS"]) + AC_MSG_RESULT([$gl_cv_cc_nomfi_supported]) + + if test "$gl_cv_cc_nomfi_supported" = yes; then + dnl Now check whether -Wno-missing-field-initializers is needed + dnl for the { 0, } construct. + AC_MSG_CHECKING([whether -Wno-missing-field-initializers is needed]) + AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[void f (void) + { + typedef struct { int a; int b; } s_t; + s_t s1 = { 0, }; + } + ]], + [[]])], + [gl_cv_cc_nomfi_needed=no], + [gl_cv_cc_nomfi_needed=yes]) + CFLAGS="$gl_save_CFLAGS" + ]) + AC_MSG_RESULT([$gl_cv_cc_nomfi_needed]) + fi + fi + + gl_manywarn_set= + for gl_manywarn_item in \ + -Wall \ + -W \ + -Wformat-y2k \ + -Wformat-nonliteral \ + -Wformat-security \ + -Winit-self \ + -Wmissing-include-dirs \ + -Wswitch-default \ + -Wswitch-enum \ + -Wunused \ + -Wunknown-pragmas \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wsystem-headers \ + -Wfloat-equal \ + -Wtraditional \ + -Wtraditional-conversion \ + -Wdeclaration-after-statement \ + -Wundef \ + -Wshadow \ + -Wunsafe-loop-optimizations \ + -Wpointer-arith \ + -Wbad-function-cast \ + -Wc++-compat \ + -Wcast-qual \ + -Wcast-align \ + -Wwrite-strings \ + -Wconversion \ + -Wsign-conversion \ + -Wlogical-op \ + -Waggregate-return \ + -Wstrict-prototypes \ + -Wold-style-definition \ + -Wmissing-prototypes \ + -Wmissing-declarations \ + -Wmissing-noreturn \ + -Wmissing-format-attribute \ + -Wpacked \ + -Wpadded \ + -Wredundant-decls \ + -Wnested-externs \ + -Wunreachable-code \ + -Winline \ + -Winvalid-pch \ + -Wlong-long \ + -Wvla \ + -Wvolatile-register-var \ + -Wdisabled-optimization \ + -Wstack-protector \ + -Woverlength-strings \ + -Wbuiltin-macro-redefined \ + -Wmudflap \ + -Wpacked-bitfield-compat \ + -Wsync-nand \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + # The following are not documented in the manual but are included in + # output from gcc --help=warnings. + for gl_manywarn_item in \ + -Wattributes \ + -Wcoverage-mismatch \ + -Wmultichar \ + -Wunused-macros \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + # More warnings from gcc 4.6.2 --help=warnings. + for gl_manywarn_item in \ + -Wabi \ + -Wcpp \ + -Wdeprecated \ + -Wdeprecated-declarations \ + -Wdiv-by-zero \ + -Wdouble-promotion \ + -Wendif-labels \ + -Wextra \ + -Wformat-contains-nul \ + -Wformat-extra-args \ + -Wformat-zero-length \ + -Wformat=2 \ + -Wmultichar \ + -Wnormalized=nfc \ + -Woverflow \ + -Wpointer-to-int-cast \ + -Wpragmas \ + -Wsuggest-attribute=const \ + -Wsuggest-attribute=noreturn \ + -Wsuggest-attribute=pure \ + -Wtrampolines \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + + # Disable the missing-field-initializers warning if needed + if test "$gl_cv_cc_nomfi_needed" = yes; then + gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" + fi + + $1=$gl_manywarn_set +]) === added file 'm4/warnings.m4' --- m4/warnings.m4 1970-01-01 00:00:00 +0000 +++ m4/warnings.m4 2012-04-09 07:45:59 +0000 @@ -0,0 +1,42 @@ +# warnings.m4 serial 6 +dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Simon Josefsson + +# gl_AS_VAR_APPEND(VAR, VALUE) +# ---------------------------- +# Provide the functionality of AS_VAR_APPEND if Autoconf does not have it. +m4_ifdef([AS_VAR_APPEND], +[m4_copy([AS_VAR_APPEND], [gl_AS_VAR_APPEND])], +[m4_define([gl_AS_VAR_APPEND], +[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])]) + + +# gl_WARN_ADD(PARAMETER, [VARIABLE = WARN_CFLAGS]) +# ------------------------------------------------ +# Adds parameter to WARN_CFLAGS if the compiler supports it. For example, +# gl_WARN_ADD([-Wparentheses]). +# +# If VARIABLE is a variable name, AC_SUBST it. +AC_DEFUN([gl_WARN_ADD], +dnl FIXME: gl_Warn must be used unquoted until we can assume +dnl autoconf 2.64 or newer. +[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl +AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [ + gl_save_compiler_FLAGS="$gl_Flags" + gl_Flags="$gl_Flags $1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AS_VAR_SET(gl_Warn, [yes])], + [AS_VAR_SET(gl_Warn, [no])]) + gl_Flags="$gl_save_compiler_FLAGS" +]) +AS_VAR_IF(gl_Warn, [yes], + [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])]) +AS_VAR_POPDEF([gl_Flags])dnl +AS_VAR_POPDEF([gl_Warn])dnl +m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl +]) === modified file 'oldXMenu/ChangeLog' --- oldXMenu/ChangeLog 2012-02-09 07:48:22 +0000 +++ oldXMenu/ChangeLog 2012-04-09 07:45:59 +0000 @@ -1,3 +1,10 @@ +2012-04-09 Paul Eggert + + configure: new option --enable-gcc-warnings + * Makefile.in (C_WARNINGS_SWITCH): Remove. + (WARN_CFLAGS, WERROR_CFLAGS): New macros. + (ALL_CFLAGS): Use new macros rather than old. + 2011-04-16 Paul Eggert Static checks with GCC 4.6.0 and non-default toolkits. === modified file 'oldXMenu/Makefile.in' --- oldXMenu/Makefile.in 2012-01-19 07:21:25 +0000 +++ oldXMenu/Makefile.in 2012-04-09 07:45:59 +0000 @@ -48,8 +48,9 @@ C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@ C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ -C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@ PROFILING_CFLAGS = @PROFILING_CFLAGS@ +WARN_CFLAGS = @WARN_CFLAGS@ +WERROR_CFLAGS = @WERROR_CFLAGS@ EXTRA=insque.o CC=@CC@ @@ -89,7 +90,7 @@ ALL_CFLAGS=$(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \ $(C_SWITCH_X_SITE) $(C_SWITCH_X_SYSTEM) \ - ${C_WARNINGS_SWITCH} ${PROFILING_CFLAGS} \ + $(WARN_CFLAGS) $(WERROR_CFLAGS) ${C_WARNINGS_SWITCH} ${PROFILING_CFLAGS} \ $(CPPFLAGS) $(CFLAGS) -DEMACS_BITMAP_FILES \ -I../src -I${srcdir} -I${srcdir}/../src === modified file 'src/ChangeLog' --- src/ChangeLog 2012-04-09 06:52:40 +0000 +++ src/ChangeLog 2012-04-09 07:45:59 +0000 @@ -1,5 +1,18 @@ 2012-04-09 Paul Eggert + configure: new option --enable-gcc-warnings + * Makefile.in (C_WARNINGS_SWITCH): Remove. + (WARN_CFLAGS, WERROR_CFLAGS): New macros. + (ALL_CFLAGS): Use new macros rather than old. + * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904. + * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore + -Wunused-but-set-variable, -Wunused-function, -Wunused-macros, + -Wunused-result, -Wunused-variable. This should go away once + the Emacs and Gnulib regex code is merged. + (xmalloc, xrealloc): Now static. + +2012-04-09 Paul Eggert + composite.c: use 'double' consistently * composite.c (get_composition_id): Use 'double' consistently instead of converting 'float' to 'double' and vice versa; this is === modified file 'src/Makefile.in' --- src/Makefile.in 2012-04-09 06:47:33 +0000 +++ src/Makefile.in 2012-04-09 07:45:59 +0000 @@ -68,7 +68,8 @@ PROFILING_CFLAGS = @PROFILING_CFLAGS@ ## Flags to pass to the compiler to enable build warnings -C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@ +WARN_CFLAGS = @WARN_CFLAGS@ +WERROR_CFLAGS = @WERROR_CFLAGS@ ## Machine-specific CFLAGS. C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ @@ -314,7 +315,7 @@ $(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \ $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) $(PROFILING_CFLAGS) \ $(LIBGNUTLS_CFLAGS) \ - $(C_WARNINGS_SWITCH) $(CFLAGS) + $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS) ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS) .SUFFIXES: .m === modified file 'src/process.c' --- src/process.c 2012-03-23 12:23:14 +0000 +++ src/process.c 2012-04-09 07:45:59 +0000 @@ -120,6 +120,13 @@ #include "nsterm.h" #endif +/* Work around GCC 4.7.0 bug with strict overflow checking; see + . + These lines can be removed once the GCC bug is fixed. */ +#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic ignored "-Wstrict-overflow" +#endif + Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname, Qtpgid; Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime, Qcstime; Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs; === modified file 'src/regex.c' --- src/regex.c 2012-01-19 07:21:25 +0000 +++ src/regex.c 2012-04-09 07:45:59 +0000 @@ -33,6 +33,19 @@ #pragma alloca #endif +/* Ignore some GCC warnings for now. This section should go away + once the Emacs and Gnulib regex code is merged. */ +#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic ignored "-Wstrict-overflow" +# ifndef emacs +# pragma GCC diagnostic ignored "-Wunused-but-set-variable" +# pragma GCC diagnostic ignored "-Wunused-function" +# pragma GCC diagnostic ignored "-Wunused-macros" +# pragma GCC diagnostic ignored "-Wunused-result" +# pragma GCC diagnostic ignored "-Wunused-variable" +# endif +#endif + #ifdef HAVE_CONFIG_H # include #endif @@ -198,7 +211,7 @@ /* When used in Emacs's lib-src, we need xmalloc and xrealloc. */ -void * +static void * xmalloc (size_t size) { register void *val; @@ -211,7 +224,7 @@ return val; } -void * +static void * xrealloc (void *block, size_t size) { register void *val; From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 18 13:19:39 2012 Received: (at 11207-done) by debbugs.gnu.org; 18 Apr 2012 17:19:39 +0000 Received: from localhost ([127.0.0.1]:40109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKYXb-0000Tp-1Z for submit@debbugs.gnu.org; Wed, 18 Apr 2012 13:19:39 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:51821) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKYXY-0000Tc-18 for 11207-done@debbugs.gnu.org; Wed, 18 Apr 2012 13:19:37 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 231F739E800C for <11207-done@debbugs.gnu.org>; Wed, 18 Apr 2012 10:19:16 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rIEVoCLDCVYa for <11207-done@debbugs.gnu.org>; Wed, 18 Apr 2012 10:19:15 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id D402239E8008 for <11207-done@debbugs.gnu.org>; Wed, 18 Apr 2012 10:19:15 -0700 (PDT) Message-ID: <4F8EF793.8020900@cs.ucla.edu> Date: Wed, 18 Apr 2012 10:19:15 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: 11207-done@debbugs.gnu.org Subject: Re: bug#11207: Acknowledgement (configure: new option --enable-gcc-warnings) References: <4F829688.6080602@cs.ucla.edu> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11207-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) I installed a slightly updated version of that patch into the trunk as bzr 107961 and am marking this as done. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 21 04:06:28 2012 Received: (at 11207) by debbugs.gnu.org; 21 Apr 2012 08:06:28 +0000 Received: from localhost ([127.0.0.1]:45054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLVKp-0006ty-FP for submit@debbugs.gnu.org; Sat, 21 Apr 2012 04:06:27 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:41769) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLVKj-0006tf-Dr for 11207@debbugs.gnu.org; Sat, 21 Apr 2012 04:06:22 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3VZRM84rFLz4LDdt; Sat, 21 Apr 2012 10:05:39 +0200 (CEST) Received: from linux.local (ppp-88-217-127-121.dynamic.mnet-online.de [88.217.127.121]) by mail.mnet-online.de (Postfix) with ESMTPA id 3VZRM743tPz4KK74; Sat, 21 Apr 2012 10:05:39 +0200 (CEST) Received: by linux.local (Postfix, from userid 501) id 880D81E53C6; Sat, 21 Apr 2012 10:05:36 +0200 (CEST) From: Andreas Schwab To: Paul Eggert Subject: Re: bug#11207: configure: new option --enable-gcc-warnings References: <4F829688.6080602@cs.ucla.edu> X-Yow: How's the wife? Is she at home enjoying capitalism? Date: Sat, 21 Apr 2012 10:05:36 +0200 In-Reply-To: <4F829688.6080602@cs.ucla.edu> (Paul Eggert's message of "Mon, 09 Apr 2012 00:58:00 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11207 Cc: 11207@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) You didn't regenerate m4/gl-comp.m4, which caused bug 11285. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 21 13:20:35 2012 Received: (at 11207) by debbugs.gnu.org; 21 Apr 2012 17:20:35 +0000 Received: from localhost ([127.0.0.1]:45919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLdz3-0005bq-T4 for submit@debbugs.gnu.org; Sat, 21 Apr 2012 13:20:34 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:37840) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLdyw-0005bZ-Mf for 11207@debbugs.gnu.org; Sat, 21 Apr 2012 13:20:28 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id AA5E9A60001; Sat, 21 Apr 2012 10:19:45 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DJTcuIziwhdm; Sat, 21 Apr 2012 10:19:39 -0700 (PDT) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 8199DA60004; Sat, 21 Apr 2012 10:19:39 -0700 (PDT) Message-ID: <4F92EC32.9040407@cs.ucla.edu> Date: Sat, 21 Apr 2012 10:19:46 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Andreas Schwab Subject: Re: bug#11207: configure: new option --enable-gcc-warnings References: <4F829688.6080602@cs.ucla.edu> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11207 Cc: 11207@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On 04/21/2012 01:05 AM, Andreas Schwab wrote: > You didn't regenerate m4/gl-comp.m4, which caused bug 11285. Thanks for fixing that. Odd; the code worked for me without that change. Maybe because I used a newer version of autoconf? Anyway I installed this further patch as a minor further cleanup, as bzr 107986: === modified file 'ChangeLog' --- ChangeLog 2012-04-21 08:03:41 +0000 +++ ChangeLog 2012-04-21 17:15:03 +0000 @@ -1,3 +1,12 @@ +2012-04-21 Paul Eggert + + Sync from gnulib version 4f11d6bebc3098c64ffde27079ab0d0cecfd0cdc + dated 2011-10-07. Regenerating from current gnulib would be a + pervasive change, and currently the trunk isn't open to such changes. + * configure.in (WARN_CFLAGS): Remove; no longer needed now + that gnulib does it. + * lib/gnulib.mk, m4/gl-comp.m4: Regenerate. + 2012-04-21 Andreas Schwab * m4/gl-comp.m4: Update. (Bug#11285) === modified file 'configure.in' --- configure.in 2012-04-20 08:48:50 +0000 +++ configure.in 2012-04-21 17:15:03 +0000 @@ -787,8 +787,6 @@ gl_WARN_ADD([-fdiagnostics-show-option]) gl_WARN_ADD([-funit-at-a-time]) - AC_SUBST([WARN_CFLAGS]) - AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.]) AC_DEFINE([_FORTIFY_SOURCE], [2], [enable compile-time and run-time bounds-checking, and some warnings]) === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2012-02-01 06:04:34 +0000 +++ lib/gnulib.mk 2012-04-21 17:15:03 +0000 @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime pthread_sigmask readlink socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat manywarnings mktime pthread_sigmask readlink socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat warnings MOSTLYCLEANFILES += core *.stackdump === modified file 'm4/gl-comp.m4' --- m4/gl-comp.m4 2012-04-21 08:03:41 +0000 +++ m4/gl-comp.m4 2012-04-21 17:15:03 +0000 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2012 Free Software Foundation, Inc. +# Copyright (C) 2002-2011 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -62,6 +62,7 @@ # Code from module largefile: AC_REQUIRE([AC_SYS_LARGEFILE]) # Code from module lstat: + # Code from module manywarnings: # Code from module mktime: # Code from module multiarch: # Code from module nocrash: @@ -100,6 +101,7 @@ # Code from module u64: # Code from module unistd: # Code from module verify: + # Code from module warnings: ]) # This macro should be invoked from ./configure.in, in the section @@ -216,6 +218,7 @@ gl_TIME_MODULE_INDICATOR([time_r]) AC_REQUIRE([AC_C_INLINE]) gl_UNISTD_H +AC_SUBST([WARN_CFLAGS]) gl_gnulib_enabled_dosname=false gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false gl_gnulib_enabled_pathmax=false From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 21 15:38:25 2012 Received: (at 11207) by debbugs.gnu.org; 21 Apr 2012 19:38:25 +0000 Received: from localhost ([127.0.0.1]:46056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLg8S-0000PU-Rv for submit@debbugs.gnu.org; Sat, 21 Apr 2012 15:38:25 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:48591) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLg8N-0000PG-1D for 11207@debbugs.gnu.org; Sat, 21 Apr 2012 15:38:19 -0400 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3VZkjd5SpYz3hhT4; Sat, 21 Apr 2012 21:37:40 +0200 (CEST) Received: from igel.home (ppp-88-217-127-121.dynamic.mnet-online.de [88.217.127.121]) by mail.mnet-online.de (Postfix) with ESMTPA id 3VZkjc5Qybz4KK2m; Sat, 21 Apr 2012 21:37:40 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 7057DCA29F; Sat, 21 Apr 2012 21:37:40 +0200 (CEST) From: Andreas Schwab To: Paul Eggert Subject: Re: bug#11207: configure: new option --enable-gcc-warnings References: <4F829688.6080602@cs.ucla.edu> <4F92EC32.9040407@cs.ucla.edu> X-Yow: I like the way ONLY their mouths move.. They look like DYING OYSTERS Date: Sat, 21 Apr 2012 21:37:40 +0200 In-Reply-To: <4F92EC32.9040407@cs.ucla.edu> (Paul Eggert's message of "Sat, 21 Apr 2012 10:19:46 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11207 Cc: 11207@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Paul Eggert writes: > Thanks for fixing that. Odd; the code worked for me > without that change. You didn't test it properly. A proper test would be to build the previous revision, install the change and build again. $ git checkout 42881f5^; make; git checkout 42881f5; make Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 21 17:14:30 2012 Received: (at 11207) by debbugs.gnu.org; 21 Apr 2012 21:14:30 +0000 Received: from localhost ([127.0.0.1]:46124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLhdS-0002ay-2d for submit@debbugs.gnu.org; Sat, 21 Apr 2012 17:14:30 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:37727) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLhdM-0002ai-Dk for 11207@debbugs.gnu.org; Sat, 21 Apr 2012 17:14:24 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 84D8239E800B; Sat, 21 Apr 2012 14:13:42 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X8BivS2I6gLb; Sat, 21 Apr 2012 14:13:36 -0700 (PDT) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id A517639E8007; Sat, 21 Apr 2012 14:13:36 -0700 (PDT) Message-ID: <4F932309.2070608@cs.ucla.edu> Date: Sat, 21 Apr 2012 14:13:45 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Andreas Schwab Subject: Re: bug#11207: configure: new option --enable-gcc-warnings References: <4F829688.6080602@cs.ucla.edu> <4F92EC32.9040407@cs.ucla.edu> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11207 Cc: 11207@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On 04/21/2012 12:37 PM, Andreas Schwab wrote: > $ git checkout 42881f5^; make; git checkout 42881f5; make OK, that explains it. I ran autogen.sh and 'configure' after applying the patch, rather than just "make". In general, "make" doesn't always work after arbitrary changes to makefiles, or changes to files that cause changes to makefiles. The current Emacs build procedure has heuristics that try to guess when to work around this problem, but the heuristics didn't work in this case. I don't use git to maintain Emacs, but I reproduced the problem this way: bzr branch -r107960 trunk trunk-tmp cd trunk-tmp ./autogen.sh ./configure make (cd ../trunk && bzr diff -r107960..107961) | patch -p0 make From unknown Tue Jun 17 20:08:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 20 May 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 03 15:38:17 2012 Received: (at control) by debbugs.gnu.org; 3 Jul 2012 19:38:17 +0000 Received: from localhost ([127.0.0.1]:45895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sm8vR-0002Jl-6O for submit@debbugs.gnu.org; Tue, 03 Jul 2012 15:38:17 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:58676) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sm8vO-0002Jb-Vy for control@debbugs.gnu.org; Tue, 03 Jul 2012 15:38:15 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Sm8qp-0000zP-MG for control@debbugs.gnu.org; Tue, 03 Jul 2012 15:33:31 -0400 Date: Tue, 03 Jul 2012 15:33:31 -0400 Message-Id: Subject: control message for bug 11207 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) unarchive 11207 From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 03 15:42:37 2012 Received: (at 11207) by debbugs.gnu.org; 3 Jul 2012 19:42:38 +0000 Received: from localhost ([127.0.0.1]:45905 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sm8zd-0002Pp-OB for submit@debbugs.gnu.org; Tue, 03 Jul 2012 15:42:37 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:58733) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sm8zb-0002Ph-35 for 11207@debbugs.gnu.org; Tue, 03 Jul 2012 15:42:35 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Sm8v0-0001D3-5c; Tue, 03 Jul 2012 15:37:50 -0400 From: Glenn Morris To: Paul Eggert Subject: Re: bug#11207: configure: new option --enable-gcc-warnings References: <4F829688.6080602@cs.ucla.edu> X-Spook: virus SSL counter intelligence wire transfer BLU-97 A/B X-Ran: =\Rmmc+"GoX:m-zAOiBGT^@Vw_F>UzYi;,,l]@-d?W?y?E3#d+`QE (Paul Eggert's message of "Mon, 09 Apr 2012 00:58:00 -0700") Message-ID: <4562a4octt.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: 11207 Cc: 11207@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.7 (-----) Paul Eggert wrote: > --- src/regex.c 2012-01-19 07:21:25 +0000 > +++ src/regex.c 2012-04-09 07:45:59 +0000 > @@ -33,6 +33,19 @@ > #pragma alloca > #endif > > +/* Ignore some GCC warnings for now. This section should go away > + once the Emacs and Gnulib regex code is merged. */ > +#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ > +# pragma GCC diagnostic ignored "-Wstrict-overflow" > +# ifndef emacs > +# pragma GCC diagnostic ignored "-Wunused-but-set-variable" > +# pragma GCC diagnostic ignored "-Wunused-function" > +# pragma GCC diagnostic ignored "-Wunused-macros" > +# pragma GCC diagnostic ignored "-Wunused-result" > +# pragma GCC diagnostic ignored "-Wunused-variable" > +# endif > +#endif For me on RHEL6, using gcc 4.4.6 20110731 (Red Hat 4.4.6-3), the "-Wunused-result" line causes a gripe when building lib-src/regex.o: src/regex.c:44: warning: unknown option after '#pragma GCC diagnostic' kind From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 03 20:42:17 2012 Received: (at 11207) by debbugs.gnu.org; 4 Jul 2012 00:42:18 +0000 Received: from localhost ([127.0.0.1]:46472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmDfd-0001wX-JN for submit@debbugs.gnu.org; Tue, 03 Jul 2012 20:42:17 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:46545) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmDfb-0001wO-DK for 11207@debbugs.gnu.org; Tue, 03 Jul 2012 20:42:16 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id B8D9939E8100; Tue, 3 Jul 2012 17:37:30 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PU6jHpOHkJDf; Tue, 3 Jul 2012 17:37:30 -0700 (PDT) Received: from [192.168.1.4] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 6006339E80E1; Tue, 3 Jul 2012 17:37:30 -0700 (PDT) Message-ID: <4FF3904B.8080602@cs.ucla.edu> Date: Tue, 03 Jul 2012 17:37:31 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Glenn Morris Subject: Re: bug#11207: configure: new option --enable-gcc-warnings References: <4F829688.6080602@cs.ucla.edu> <4562a4octt.fsf@fencepost.gnu.org> In-Reply-To: <4562a4octt.fsf@fencepost.gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11207 Cc: 11207@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On 07/03/2012 12:37 PM, Glenn Morris wrote: > src/regex.c:44: warning: unknown option after '#pragma GCC diagnostic' kind Thanks, I fixed this in trunk bzr 108851. From unknown Tue Jun 17 20:08:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 01 Aug 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator