summaryrefslogtreecommitdiff
path: root/gcc/cppmacro.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-27 19:08:36 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-27 19:08:36 +0000
commitb6bf9cd5321cff75587c6386927e9abaf51b3198 (patch)
tree376dab862876e9b09630f6d229b81ba1eeb2fa61 /gcc/cppmacro.c
parent562169a7750058ac1f9751c2708535e61638dda0 (diff)
downloadgcc-b6bf9cd5321cff75587c6386927e9abaf51b3198.tar.gz
* cppinit.c (cpp_reader_init): Remove handling of warn_paste
command line options. (cpp_handle_option): Similarly. * cpplib.h (struct cpp_options): Remove warn_paste. * cppmacro.c (paste_tokens): Apart from assembler, make unpasteable token warning mandatory. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37804 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r--gcc/cppmacro.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index af520ef036e..f9291bcdc40 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -379,17 +379,20 @@ paste_tokens (pfile, lhs, rhs)
if (type == CPP_EOF)
{
- if (CPP_OPTION (pfile, warn_paste))
+ /* Mandatory warning for all apart from assembler. */
+ if (CPP_OPTION (pfile, lang) != CLK_ASM)
cpp_warning (pfile,
"pasting \"%s\" and \"%s\" does not give a valid preprocessing token",
cpp_token_as_text (pfile, lhs),
cpp_token_as_text (pfile, rhs));
/* The standard states that behaviour is undefined. By the
- principle of least surpise, we step back before the RHS, and
- mark it to prevent macro expansion. Tests in the testsuite
- rely on clearing PREV_WHITE here, though you could argue we
- should actually set it. */
+ principle of least surpise, we step back before the RHS, and
+ mark it to prevent macro expansion. Tests in the testsuite
+ rely on clearing PREV_WHITE here, though you could argue we
+ should actually set it. Assembler can have '.' in labels and
+ so requires that we don't insert spaces there. Maybe we should
+ change this to put out a space unless it's assembler. */
rhs->flags &= ~PREV_WHITE;
rhs->flags |= NO_EXPAND;
return 1;