summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2010-01-07 15:57:38 -0700
committerEric Blake <ebb9@byu.net>2010-01-08 18:09:39 -0700
commit8b8afe81fe7dbda9cf1dea6c18a1b4d56e871c7e (patch)
tree6f75609a58a9dd13f420762ad47abf4ddf0b713e
parent26b4e1ec676c285bef3209f85e82dc23143b1211 (diff)
downloadm4-8b8afe81fe7dbda9cf1dea6c18a1b4d56e871c7e.tar.gz
Address remaining 'make syntax-check' findings.
* gnulib: Update to latest. * Makefile.am (tests/package.m4): Avoid @@ substitution. (src_m4_LDADD): Link with libiconv. * m4/m4private.h (STREQ): New macro. * m4/resyntax.c (m4_regexp_syntax_encode): Use it. * src/main.c (process_file): Likewise. (includes): Drop unused header. * m4/macro.c (m4_arg_equal): Adjust comment. * m4/syntax.c: Likewise. * m4/system_.h: Avoid useless preprocessor parenthesis. * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise. * src/stackovf.c: Likewise. (setup_stackovf_trap): Mark diagnostics. * modules/mpeval.c (includes): Move quotearg.h inclusion... * modules/evalparse.c (includes): ...to where it is used. * cfg.mk (local-checks-to-skip): Exempt tests that cause spurious failures, but first fix what they were intended to detect. (_makefile_at_at_check_exceptions): Allow an exception. Signed-off-by: Eric Blake <ebb9@byu.net> (cherry picked from commit 2f6096389e2047a01618419af3f4471735444520)
-rw-r--r--ChangeLog22
-rw-r--r--Makefile.am12
-rw-r--r--cfg.mk10
m---------gnulib0
-rw-r--r--ltdl/m4/stackovf.m46
-rw-r--r--m4/m4private.h3
-rw-r--r--m4/macro.c4
-rw-r--r--m4/resyntax.c2
-rw-r--r--m4/syntax.c2
-rw-r--r--m4/system_.h4
-rw-r--r--modules/evalparse.c2
-rw-r--r--modules/mpeval.c2
-rw-r--r--src/main.c3
-rw-r--r--src/stackovf.c12
14 files changed, 58 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 45744aa2..9faab841 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2010-01-08 Eric Blake <ebb9@byu.net>
+
+ Address remaining 'make syntax-check' findings.
+ * gnulib: Update to latest.
+ * Makefile.am (tests/package.m4): Avoid @@ substitution.
+ (src_m4_LDADD): Link with libiconv.
+ * m4/m4private.h (STREQ): New macro.
+ * m4/resyntax.c (m4_regexp_syntax_encode): Use it.
+ * src/main.c (process_file): Likewise.
+ (includes): Drop unused header.
+ * m4/macro.c (m4_arg_equal): Adjust comment.
+ * m4/syntax.c: Likewise.
+ * m4/system_.h: Avoid useless preprocessor parenthesis.
+ * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
+ * src/stackovf.c: Likewise.
+ (setup_stackovf_trap): Mark diagnostics.
+ * modules/mpeval.c (includes): Move quotearg.h inclusion...
+ * modules/evalparse.c (includes): ...to where it is used.
+ * cfg.mk (local-checks-to-skip): Exempt tests that cause spurious
+ failures, but first fix what they were intended to detect.
+ (_makefile_at_at_check_exceptions): Allow an exception.
+
2010-01-07 Eric Blake <ebb9@byu.net>
Use correct license on auxiliary documentation.
diff --git a/Makefile.am b/Makefile.am
index ddffcff8..ecba57ff 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -102,7 +102,7 @@ src_m4_SOURCES += src/stackovf.c
endif
src_m4_CPPFLAGS = $(AM_CPPFLAGS) -Isrc -I$(srcdir)/src
src_m4_LDFLAGS = $(AM_LDFLAGS) $(DLPREOPEN)
-src_m4_LDADD = m4/libm4.la
+src_m4_LDADD = m4/libm4.la $(LTLIBICONV)
src_m4_DEPENDENCIES = $(PREOPEN_DEPENDENCIES) m4/libm4.la
## ##
@@ -383,11 +383,11 @@ $(srcdir)/tests/package.m4: .version
:; \
{ \
echo '# Signature of the current package.'; \
- echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
- echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
- echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
- echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
- echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
+ echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])'; \
+ echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])'; \
+ echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])'; \
+ echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])'; \
+ echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
} > $(srcdir)/tests/package.m4
tests/atconfig: config.status
diff --git a/cfg.mk b/cfg.mk
index e6616a04..25a02372 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -19,7 +19,15 @@ manual_title = GNU macro processor
# Tests not to run as part of "make syntax-check".
# M4 intentionally uses a coding style that compiles under C++.
-local-checks-to-skip = sc_cast_of_x_alloc_return_value
+# sc_proper_name_utf8_requires_ICONV doesn't work with non-recursive Makefile
+# sc_po_check assumes a directory layout that we don't quite provide
+local-checks-to-skip = sc_cast_of_x_alloc_return_value \
+ sc_proper_name_utf8_requires_ICONV \
+ sc_po_check
+
+# PRAGMA_SYSTEM_HEADER includes #, which does not work through a
+# Makefile variable, so we exempt it.
+_makefile_at_at_check_exceptions = ' && !/PRAGMA_SYSTEM_HEADER/'
# Hash of NEWS contents, to ensure we don't add entries to wrong section.
old_NEWS_hash = 0ef74b67f86e4f4ec20b67f02d9b1124
diff --git a/gnulib b/gnulib
-Subproject c1a179cd48726257211e503550e1199da90c846
+Subproject c535f4489b41f28afd115ae331d69595ea41b6a
diff --git a/ltdl/m4/stackovf.m4 b/ltdl/m4/stackovf.m4
index 8b9232ef..3bf57ad2 100644
--- a/ltdl/m4/stackovf.m4
+++ b/ltdl/m4/stackovf.m4
@@ -19,7 +19,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# serial 6
+# serial 7
# M4_SYS_STACKOVF
# ---------------
@@ -49,8 +49,8 @@ if test "$ac_cv_func_sigaction" = yes || test "$ac_cv_func_sigvec" = yes; then
#include <sys/resource.h>
#include <signal.h>
]], [[struct rlimit r; getrlimit (RLIMIT_STACK, &r);
-#if (!defined(HAVE_SIGACTION) || !defined(SA_ONSTACK)) \
- && (!defined(HAVE_SIGVEC) || !defined(SV_ONSTACK))
+#if (!defined HAVE_SIGACTION || !defined SA_ONSTACK) \
+ && (!defined HAVE_SIGVEC || !defined SV_ONSTACK)
choke me /* SA_ONSTACK and/or SV_ONSTACK are not defined */
#endif
]])], [M4_cv_use_stackovf=yes])
diff --git a/m4/m4private.h b/m4/m4private.h
index 0ee10e24..f7b47f85 100644
--- a/m4/m4private.h
+++ b/m4/m4private.h
@@ -619,6 +619,9 @@ extern void m4__include_init (m4 *);
casting away any const. */
#define DELETE(Expr) ((Expr) = (free ((void *) (Expr)), (void *) 0))
+/* Avoid negative logic when comparing two strings. */
+#define STREQ(a, b) (strcmp (a, b) == 0)
+
#if DEBUG
# define DEBUG_INCL 1
diff --git a/m4/macro.c b/m4/macro.c
index b88d5cbe..d4147819 100644
--- a/m4/macro.c
+++ b/m4/macro.c
@@ -1272,8 +1272,8 @@ m4_arg_text (m4 *context, m4_macro_args *argv, size_t arg, bool flatten)
/* Given ARGV, compare text arguments INDEXA and INDEXB for equality.
Both indices must be non-zero. Return true if the arguments
contain the same contents; often more efficient than
- !strcmp (m4_arg_text (context, argv, indexa),
- m4_arg_text (context, argv, indexb)). */
+ STREQ (m4_arg_text (context, argv, indexa),
+ m4_arg_text (context, argv, indexb)). */
bool
m4_arg_equal (m4 *context, m4_macro_args *argv, size_t indexa, size_t indexb)
{
diff --git a/m4/resyntax.c b/m4/resyntax.c
index 5e7b9701..6f6a379a 100644
--- a/m4/resyntax.c
+++ b/m4/resyntax.c
@@ -99,7 +99,7 @@ m4_regexp_syntax_encode (const char *spec)
for (resyntax = m4_resyntax_map; resyntax->spec != NULL; ++resyntax)
{
- if (!strcmp (resyntax->spec, canonical))
+ if (STREQ (resyntax->spec, canonical))
break;
}
diff --git a/m4/syntax.c b/m4/syntax.c
index 9e8cf42e..792a97f9 100644
--- a/m4/syntax.c
+++ b/m4/syntax.c
@@ -63,7 +63,7 @@
will not show up in the syntax-table.
Having a syntax table allows new facilities. The new builtin
- "changesyntax" allows the the user to change the category of any
+ "changesyntax" allows the user to change the category of any
character.
By default, '\n' is both ECOMM and SPACE, depending on the context.
diff --git a/m4/system_.h b/m4/system_.h
index 458c2ffb..aa28247b 100644
--- a/m4/system_.h
+++ b/m4/system_.h
@@ -114,11 +114,11 @@ BEGIN_C_DECLS
a way sympathetic to the compiler to maximise optimization. */
#undef M4_STMT_START
#undef M4_STMT_END
-#if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus)
+#if defined __GNUC__ && !defined __STRICT_ANSI__ && !defined __cplusplus
# define M4_STMT_START (void)(
# define M4_STMT_END )
#else
-# if (defined (sun) || defined (__sun__))
+# if defined sun || defined __sun__
# define M4_STMT_START if (1)
# define M4_STMT_END else (void)0
# else
diff --git a/modules/evalparse.c b/modules/evalparse.c
index 3ed29d74..574541e6 100644
--- a/modules/evalparse.c
+++ b/modules/evalparse.c
@@ -35,6 +35,8 @@
both `eval' and `mpeval', but which is redefined appropriately when
this file is #included into its clients. */
+#include "quotearg.h"
+
typedef enum eval_token
{
ERROR, BADOP,
diff --git a/modules/mpeval.c b/modules/mpeval.c
index 44a0d3d0..ae620cbc 100644
--- a/modules/mpeval.c
+++ b/modules/mpeval.c
@@ -32,8 +32,6 @@
# include <gmp.h>
#endif
-#include "quotearg.h"
-
/* Rename exported symbols for dlpreload()ing. */
#define m4_builtin_table mpeval_LTX_m4_builtin_table
#define m4_macro_table mpeval_LTX_m4_macro_table
diff --git a/src/main.c b/src/main.c
index e9f2599b..240e241d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -26,7 +26,6 @@
#include "m4.h"
-#include "close-stream.h"
#include "closein.h"
#include "configmake.h"
#include "getopt.h"
@@ -302,7 +301,7 @@ size_opt (char const *opt, int oi, int optchar)
static void
process_file (m4 *context, const char *name)
{
- if (strcmp (name, "-") == 0)
+ if (STREQ (name, "-"))
/* TRANSLATORS: This is a short name for `standard input', used
when a command line file was given as `-'. */
m4_push_file (context, stdin, _("stdin"), false);
diff --git a/src/stackovf.c b/src/stackovf.c
index 95a5c3a2..fb2aa1a5 100644
--- a/src/stackovf.c
+++ b/src/stackovf.c
@@ -118,7 +118,7 @@
typedef void (*handler_t) (void);
-#if defined(__ultrix) && defined(__vax)
+#if defined __ultrix && defined __vax
extern char *sbrk (int);
extern int getrlimit (int, struct rlimit *);
extern int sigstack (struct sigstack *, struct sigstack *);
@@ -313,7 +313,7 @@ Error - Do not know how to set up stack-ovf trap handler...
/* Calculate the approximate expected addr for a stack-ovf trap. */
if (getrlimit (RLIMIT_STACK, &rl) < 0)
- error (EXIT_FAILURE, errno, "getrlimit");
+ error (EXIT_FAILURE, errno, _("getrlimit"));
stack_len = (rl.rlim_cur < rl.rlim_max ? rl.rlim_cur : rl.rlim_max);
stackbot = (char *) argv;
grows_upward = ((char *) &stack_len > stackbot);
@@ -386,7 +386,7 @@ Error - Do not know how to set up stack-ovf trap handler...
free (stackbuf);
if (errno == ENOSYS)
return;
- error (EXIT_FAILURE, errno, "sigaltstack");
+ error (EXIT_FAILURE, errno, _("sigaltstack"));
}
}
@@ -408,7 +408,7 @@ Error - Do not know how to set up stack-ovf trap handler...
free (stackbuf);
if (errno == ENOSYS)
return;
- error (EXIT_FAILURE, errno, "sigstack");
+ error (EXIT_FAILURE, errno, _("sigstack"));
}
}
@@ -431,7 +431,7 @@ Error - Do not know how to set up stack-ovf trap handler...
sigemptyset (&act.sa_mask);
act.sa_flags = (SA_ONSTACK | SA_RESETHAND | SA_SIGINFO);
if (sigaction (SIGSEGV, &act, NULL) < 0)
- error (EXIT_FAILURE, errno, "sigaction");
+ error (EXIT_FAILURE, errno, _("sigaction"));
#else /* ! HAVE_SIGACTION */
@@ -439,7 +439,7 @@ Error - Do not know how to set up stack-ovf trap handler...
vec.sv_mask = 0;
vec.sv_flags = (SV_ONSTACK | SV_RESETHAND);
if (sigvec (SIGSEGV, &vec, NULL) < 0)
- error (EXIT_FAILURE, errno, "sigvec");
+ error (EXIT_FAILURE, errno, _("sigvec"));
#endif /* ! HAVE_SIGACTION */