aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppmain.c
diff options
context:
space:
mode:
authorno-author <no-author@gcc.gnu.org>2002-06-24 16:14:28 +0000
committerno-author <no-author@gcc.gnu.org>2002-06-24 16:14:28 +0000
commitd7c16291772cee0918f2bd6c3f1976f584bb8ed6 (patch)
treed7410c5f44cfe400d0eb3e0b8e8ba23ee129f4df /gcc/cppmain.c
parentfefb15d75743dd7f453d7ed065327338b8c27017 (diff)
This commit was manufactured by cvs2svn to create taggcc_3_1_release
'gcc_3_1_release'. git-svn-id: https://gcc.gnu.org/svn/gcc/tags/gcc_3_1_release@54955 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppmain.c')
-rw-r--r--gcc/cppmain.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/cppmain.c b/gcc/cppmain.c
index ee157ca61ec..b8757c705d0 100644
--- a/gcc/cppmain.c
+++ b/gcc/cppmain.c
@@ -193,8 +193,13 @@ setup_callbacks ()
if (! options->no_output)
{
cb->line_change = cb_line_change;
- cb->ident = cb_ident;
- cb->def_pragma = cb_def_pragma;
+ /* Don't emit #pragma or #ident directives if we are processing
+ assembly language; the assembler may choke on them. */
+ if (options->lang != CLK_ASM)
+ {
+ cb->ident = cb_ident;
+ cb->def_pragma = cb_def_pragma;
+ }
if (! options->no_line_commands)
cb->file_change = cb_file_change;
}
@@ -316,8 +321,17 @@ print_line (map, line, special_flags)
print.line = line;
if (! options->no_line_commands)
{
+ size_t to_file_len = strlen (map->to_file);
+ unsigned char *to_file_quoted = alloca (to_file_len * 4 + 1);
+ unsigned char *p;
+
+ /* cpp_quote_string does not nul-terminate, so we have to do it
+ ourselves. */
+ p = cpp_quote_string (to_file_quoted,
+ (unsigned char *)map->to_file, to_file_len);
+ *p = '\0';
fprintf (print.outf, "# %u \"%s\"%s",
- SOURCE_LINE (map, print.line), map->to_file, special_flags);
+ SOURCE_LINE (map, print.line), to_file_quoted, special_flags);
if (map->sysp == 2)
fputs (" 3 4", print.outf);