+2000-11-27 Neil Booth <neilb@earthling.net>
+
+ * 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.
+
2000-11-27 Neil Booth <neilb@earthling.net>
* tradcpp.c (enum pending_dir_t, struct pending_dir): New.
}
CPP_OPTION (pfile, warn_import) = 1;
- CPP_OPTION (pfile, warn_paste) = 1;
CPP_OPTION (pfile, discard_comments) = 1;
CPP_OPTION (pfile, show_column) = 1;
CPP_OPTION (pfile, tabstop) = 8;
if (CPP_OPTION (pfile, cplusplus))
CPP_OPTION (pfile, warn_traditional) = 0;
- /* Do not warn about invalid token pasting if -lang-asm. */
- if (CPP_OPTION (pfile, lang) == CLK_ASM)
- CPP_OPTION (pfile, warn_paste) = 0;
-
/* Set this if it hasn't been set already. */
if (CPP_OPTION (pfile, user_label_prefix) == NULL)
CPP_OPTION (pfile, user_label_prefix) = USER_LABEL_PREFIX;
CPP_OPTION (pfile, warn_undef) = 1;
else if (!strcmp (argv[i], "-Wimport"))
CPP_OPTION (pfile, warn_import) = 1;
- else if (!strcmp (argv[i], "-Wpaste"))
- CPP_OPTION (pfile, warn_paste) = 1;
else if (!strcmp (argv[i], "-Werror"))
CPP_OPTION (pfile, warnings_are_errors) = 1;
else if (!strcmp (argv[i], "-Wsystem-headers"))
CPP_OPTION (pfile, warn_undef) = 0;
else if (!strcmp (argv[i], "-Wno-import"))
CPP_OPTION (pfile, warn_import) = 0;
- else if (!strcmp (argv[i], "-Wno-paste"))
- CPP_OPTION (pfile, warn_paste) = 0;
else if (!strcmp (argv[i], "-Wno-error"))
CPP_OPTION (pfile, warnings_are_errors) = 0;
else if (!strcmp (argv[i], "-Wno-system-headers"))
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;