Merge from trunk.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 10 Apr 2012 21:59:42 +0000 (14:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 10 Apr 2012 21:59:42 +0000 (14:59 -0700)
1  2 
ChangeLog
configure.in
etc/NEWS
src/ChangeLog

diff --combined ChangeLog
+++ b/ChangeLog
@@@ -1,25 -1,10 +1,27 @@@
- 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
++2012-04-10  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      configure: new option --enable-gcc-warnings (Bug#11207)
 +      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-10  Glenn Morris  <rgm@gnu.org>
+       * configure.in: Conditionally generate admin/unidata/Makefile.
  2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
  
-       * info/dir (File):
-       * Makefile.in: Add emacs-gnutls to the info directory and the
-       INFO_FILES target.
+       * info/dir, Makefile.in (INFO_FILES): Add emacs-gnutls manual.
  
  2012-04-09  Glenn Morris  <rgm@gnu.org>
  
diff --combined configure.in
    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"
 +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
 +  # <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
 +  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
 -AC_MSG_RESULT($has_option)
 -CFLAGS="$SAVE_CFLAGS"
 -unset has_option
 -unset SAVE_CFLAGS
  
 -AC_SUBST(C_WARNINGS_SWITCH)
  
  
  #### Some other nice autoconf tests.
@@@ -1201,13 -1127,8 +1201,13 @@@ AC_DEFUN([PKG_CHECK_MODULES], 
          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
@@@ -1542,7 -1463,7 +1542,7 @@@ AC_SUBST(LD_SWITCH_X_SITE_AUX
  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
@@@ -3913,6 -3834,16 +3913,16 @@@ if test -f $srcdir/${opt_makefile}.in; 
    AC_CONFIG_FILES([test/automated/Makefile])
  fi
  
+ dnl admin/ may or may not be present.
+ opt_makefile=admin/unidata/Makefile
+ if test -f $srcdir/${opt_makefile}.in; then
+   SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile"
+   AC_CONFIG_FILES([admin/unidata/Makefile])
+ fi
  SUBDIR_MAKEFILES_IN=`echo " ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'`
  
  AC_SUBST(SUBDIR_MAKEFILES_IN)
diff --combined etc/NEWS
+++ b/etc/NEWS
@@@ -22,13 -22,6 +22,13 @@@ so we will look at it and add it to th
  
  \f
  * 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.
 +
  \f
  * Startup Changes in Emacs 24.2
  
@@@ -46,6 -39,10 +46,10 @@@ been adding them there, put them somewh
  * Editing Changes in Emacs 24.2
  \f
  * Changes in Specialized Modes and Packages in Emacs 24.2
+ ** erc will look up server/channel names via auth-source and use the
+    channel keys found, if any.
  \f
  * New Modes and Packages in Emacs 24.2
  \f
diff --combined src/ChangeLog
@@@ -1,16 -1,14 +1,27 @@@
- 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
++2012-04-10  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      configure: new option --enable-gcc-warnings (Bug#11207)
 +      * 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-10  "Jason S. Cornez"  <jcornez@ravenpack.com>  (tiny change)
+       * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
+       (force_quit_count): New var.
+       (handle_interrupt): Use it.
+ 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
+       * w32.c (w32_delayed_load): Record the full path of the library
+       being loaded (bug#10424).
  2012-04-09  Glenn Morris  <rgm@gnu.org>
  
        * doc.c (Fsnarf_documentation): Check variables, functions are bound,
@@@ -25,8 -23,8 +36,8 @@@
        * process.h: Add integer `gnutls_handshakes_tried' member to
        process struct.
  
-       * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.  Add
-       convenience `GNUTLS_LOG2i' macro.
+       * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
+       Add convenience `GNUTLS_LOG2i' macro.
  
        * gnutls.c (gnutls_log_function2i): Convenience log function.
        (emacs_gnutls_read): Use new log functions,
        (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
        Calls xmlCleanupParser only if libxml2 was loaded (or statically
        linked in).
-       (Flibxml_parse_html_region, Flibxml_parse_xml_region): Call
-       init_libxml2_functions before calling libxml2 functions.
+       (Flibxml_parse_html_region, Flibxml_parse_xml_region):
+       Call init_libxml2_functions before calling libxml2 functions.
        (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
  
        * emacs.c: Don't include libxml/parser.h.