[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warning: module to simplify adding compiler warnings
From: |
Simon Josefsson |
Subject: |
Re: warning: module to simplify adding compiler warnings |
Date: |
Mon, 10 Nov 2008 20:45:12 +0100 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) |
Updated module, thanks for review!
I'll wait some more time before pushing this, in case someone finds more
serious problems or has objections.
/Simon
>From 637ecea60f31fbc4b0d45927b27d219986a1e1aa Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Mon, 10 Nov 2008 20:44:19 +0100
Subject: [PATCH] Add warnings module.
---
ChangeLog | 8 ++++++++
MODULES.html.sh | 1 +
m4/warnings.m4 | 34 ++++++++++++++++++++++++++++++++++
modules/warnings | 16 ++++++++++++++++
4 files changed, 59 insertions(+), 0 deletions(-)
create mode 100644 m4/warnings.m4
create mode 100644 modules/warnings
diff --git a/ChangeLog b/ChangeLog
index 5f36de6..747f995 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-11-10 Simon Josefsson <address@hidden>
+
+ * modules/warnings: New module.
+ * m4/warnings.m4: New file.
+ * MODULES.html.sh: Mention warnings module.
+ With review improvements from Paolo Bonzini <address@hidden>
+ and. Ralf Wildenhues <address@hidden>
+
2008-11-10 Eric Blake <address@hidden>
standards.texi: include correct file for FDL 1.3
diff --git a/MODULES.html.sh b/MODULES.html.sh
index 5198f0d..d3e5c13 100755
--- a/MODULES.html.sh
+++ b/MODULES.html.sh
@@ -2972,6 +2972,7 @@ func_all_modules ()
func_module relocatable-prog
func_module relocatable-prog-wrapper
func_module relocatable-script
+ func_module warnings
func_end_table
element="Support for building documentation"
diff --git a/m4/warnings.m4 b/m4/warnings.m4
new file mode 100644
index 0000000..594ff97
--- /dev/null
+++ b/m4/warnings.m4
@@ -0,0 +1,34 @@
+# warnings.m4 serial 1
+dnl Copyright (C) 2008 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_WARN_INIT
+# Initializes WARN_CFLAGS variable.
+AC_DEFUN([gl_WARN_INIT],
+[
+ AC_ARG_VAR(WARN_CFLAGS, [C compiler warning flags])
+])
+
+# gl_WARN_ADD([parameter]) adds parameter to WARN_CFLAGS if compiler
+# supports it. For example, use gl_WARN_ADD([-Werror]).
+AC_DEFUN([gl_WARN_ADD],
+[
+ pushdef([param],[translit([$1],[ABCDEFGHIJKLMNOPQRSTUVWXYZ./-],
+ [abcdefghijklmnopqrstuvwxyz___])])
+
+ AC_CACHE_CHECK([whether compiler handles $1], [gl_cv_warn[]param[]], [
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="${CFLAGS} $1"
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
+ gl_cv_warn[]param=yes, gl_cv_warn[]param=no)
+ CFLAGS="$save_CFLAGS"
+ ])
+
+ if test $gl_cv_warn[]param = "yes"; then
+ WARN_CFLAGS="$WARN_CFLAGS $1"
+ fi
+])
diff --git a/modules/warnings b/modules/warnings
new file mode 100644
index 0000000..bd757c5
--- /dev/null
+++ b/modules/warnings
@@ -0,0 +1,16 @@
+Description:
+Helper M4 functions for safely adding compiler warning parameters.
+
+Files:
+m4/warnings.m4
+
+Depends-on:
+
+configure.ac:
+gl_WARN_INIT
+
+License:
+unlimited
+
+Maintainer:
+Simon Josefsson
--
1.5.6.5
- warning: module to simplify adding compiler warnings, Simon Josefsson, 2008/11/10
- Re: warning: module to simplify adding compiler warnings, Paolo Bonzini, 2008/11/10
- Re: warning: module to simplify adding compiler warnings, Ralf Wildenhues, 2008/11/10
- Re: warning: module to simplify adding compiler warnings, Simon Josefsson, 2008/11/10
- Re: warning: module to simplify adding compiler warnings,
Simon Josefsson <=
- Re: warning: module to simplify adding compiler warnings, Paolo Bonzini, 2008/11/11
- Re: warning: module to simplify adding compiler warnings, Simon Josefsson, 2008/11/11
- Re: warning: module to simplify adding compiler warnings, Paolo Bonzini, 2008/11/11
- Re: warning: module to simplify adding compiler warnings, Bruno Haible, 2008/11/11
- Re: warning: module to simplify adding compiler warnings, Paolo Bonzini, 2008/11/11
- Re: warning: module to simplify adding compiler warnings, Simon Josefsson, 2008/11/11
- Re: warning: module to simplify adding compiler warnings, Paolo Bonzini, 2008/11/11
- Re: warning: module to simplify adding compiler warnings, Simon Josefsson, 2008/11/11
- Re: warning: module to simplify adding compiler warnings, Paolo Bonzini, 2008/11/11
- Re: warning: module to simplify adding compiler warnings, Simon Josefsson, 2008/11/11