summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/cppmain.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-05-09 20:02:13 +0000
committerobrien <obrien@FreeBSD.org>2002-05-09 20:02:13 +0000
commitc8f5fc7032940ad6633f932ac40cade82ec4d0cc (patch)
tree29a0f0a6c79a69ecc64f612947a0fe5904311713 /contrib/gcc/cppmain.c
parentc9ab9ae440a8066b2c2b85b157b1fdadcf09916a (diff)
downloadFreeBSD-src-c8f5fc7032940ad6633f932ac40cade82ec4d0cc.zip
FreeBSD-src-c8f5fc7032940ad6633f932ac40cade82ec4d0cc.tar.gz
Gcc 3.1.0 pre-release from the FSF anoncvs repo on 9-May-2002 15:57:15 EDT.
Diffstat (limited to 'contrib/gcc/cppmain.c')
-rw-r--r--contrib/gcc/cppmain.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/contrib/gcc/cppmain.c b/contrib/gcc/cppmain.c
index ee157ca..b8757c7 100644
--- a/contrib/gcc/cppmain.c
+++ b/contrib/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);
OpenPOWER on IntegriCloud