This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Don't emit #pragma or #ident into preprocessed assembly language
- From: Zack Weinberg <zack at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: "Billinghurst, David (CRTS)" <David dot Billinghurst at riotinto dot com>
- Date: Tue, 5 Mar 2002 23:50:04 -0800
- Subject: Don't emit #pragma or #ident into preprocessed assembly language
This patch addresses a problem observed by David Billinghurst, where
the Irix assembler chokes on #ident lines preserved in cpp output. He
has verified that it solves the problem, and bootstrapped it on
i386-cygwin, mips-irix6.5; I've also done i386-linux.
Applied to mainline and 3.1 branch. I am not putting it in 3.0 since
it does not represent a regression from 2.x (2.95 also leaves #ident
lines in assembly output).
zw
* cppmain.c (setup_callbacks): Disable #pragma and #ident
callbacks when processing assembly language.
===================================================================
Index: cppmain.c
--- cppmain.c 2002/01/03 21:43:06 1.90
+++ cppmain.c 2002/03/06 07:48:19
@@ -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;
}