summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-07-08 16:18:49 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-07-08 16:18:49 +0000
commit71fd77c9b4b3398097c48d6c1d3be7296d670f89 (patch)
treeca77b69e8b4f032f1066c6a31847233f9db7f8e5 /libcpp
parent313793ac30b7208dfb273ab1823bed6b0c20deb4 (diff)
downloadgcc-71fd77c9b4b3398097c48d6c1d3be7296d670f89.tar.gz
2008-07-08 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r137620 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@137632 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/macro.c11
2 files changed, 17 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 7f069414f7e..2d29a309566 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-13 Andrew Haley <aph@redhat.com>
+
+ PR preprocessor/33305
+ * macro.c (replace_args): Print a warning for empty macro
+ arguments in C89 and C++.
+
2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
diff --git a/libcpp/macro.c b/libcpp/macro.c
index 016754bc952..edc2856551a 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -1009,6 +1009,17 @@ replace_args (cpp_reader *pfile, cpp_hashnode *node, cpp_macro *macro, macro_arg
if (src->flags & PASTE_LEFT)
paste_flag = dest - 1;
}
+ else if (CPP_PEDANTIC (pfile) && ! macro->syshdr
+ && ! CPP_OPTION (pfile, c99)
+ && ! cpp_in_system_header (pfile))
+ {
+ cpp_error (pfile, CPP_DL_PEDWARN,
+ "invoking macro %s argument %d: "
+ "empty macro arguments are undefined"
+ " in ISO C90 and ISO C++98",
+ NODE_NAME (node),
+ src->val.arg_no);
+ }
/* Avoid paste on RHS (even case count == 0). */
if (!pfile->state.in_directive && !(src->flags & PASTE_LEFT))