aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-05-11 08:43:56 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-05-11 08:43:56 +0000
commit3ae1c615d94df87b69481555c3528f1eef01c729 (patch)
treeb752ab06bbefdbddddf43f5724b9a97a28a6af2e /gcc/cpphash.c
parent8fe3a87b4f1a25cc4cdb6a7e4123691a02f124b3 (diff)
downloadgcc-3ae1c615d94df87b69481555c3528f1eef01c729.zip
gcc-3ae1c615d94df87b69481555c3528f1eef01c729.tar.gz
gcc-3ae1c615d94df87b69481555c3528f1eef01c729.tar.bz2
cpphash.c (collect_funlike_expansion): Make "# is not followed by a macro argument name" a pedwarn, not an error.
* cpphash.c (collect_funlike_expansion): Make "# is not followed by a macro argument name" a pedwarn, not an error. Preserve the # in the output. Suppress the warning if lang_asm. * gcc.dg/dg.exp: Scan .S files as well as .c files. * gcc.dg/20000510-1.S: New. From-SVN: r33841
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 81e9368..1e61daf 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -639,7 +639,22 @@ collect_funlike_expansion (pfile, list, arglist, replacement)
default:
norm:
if (last_token == STRIZE)
- cpp_error (pfile, "# is not followed by a macro argument name");
+ {
+ /* This is a mandatory diagnostic (6.10.3.2 para 1), but
+ in assembly language # may have some other
+ significance we don't know about, so suppress the
+ warning. */
+ if (! CPP_OPTION (pfile, lang_asm))
+ cpp_pedwarn (pfile,
+ "# is not followed by a macro argument name");
+ if (TOK_PREV_WHITE (list, i))
+ CPP_ADJUST_WRITTEN (pfile, -1);
+ if (TOK_PREV_WHITE (list, i-1))
+ CPP_PUTC (pfile, ' ');
+ CPP_PUTC (pfile, '#');
+ if (TOK_PREV_WHITE (list, i))
+ CPP_PUTC (pfile, ' ');
+ }
CPP_PUTS (pfile, tok, len);
last_token = NORM;
}