summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog13
-rw-r--r--src/Makefile.in5
-rw-r--r--src/process.c7
-rw-r--r--src/regex.c17
4 files changed, 38 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2e3142b7015..ae91f04635b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,16 @@
+2012-04-18 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-17 Paul Eggert <eggert@cs.ucla.edu>
* dired.c (Fsystem_groups): Remove unused local.
diff --git a/src/Makefile.in b/src/Makefile.in
index bb9afa866af..37480f8269d 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -68,7 +68,8 @@ OTHER_FILES = @OTHER_FILES@
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@
@@ -308,7 +309,7 @@ ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I$(srcdir) \
$(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
diff --git a/src/process.c b/src/process.c
index 65020299e75..2609a9cc250 100644
--- a/src/process.c
+++ b/src/process.c
@@ -120,6 +120,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "nsterm.h"
#endif
+/* Work around GCC 4.7.0 bug with strict overflow checking; see
+ <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>.
+ 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;
diff --git a/src/regex.c b/src/regex.c
index 0f9150193ec..d16a5148054 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -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 <config.h>
#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 @@ xmalloc (size_t size)
return val;
}
-void *
+static void *
xrealloc (void *block, size_t size)
{
register void *val;