This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
On Sep 14, 2003, Andrew Pinski <pinskia@physics.uc.edu> wrote: > This is most definitely this patch: > +2003-09-14 Alexandre Oliva <aoliva@redhat.com> > + > + * c-ppoutput.c (cb_line_change): Revert 2003-08-04's change. > + * c-lex.c (cb_line_change): Skip line changing whenever > + c-ppoutput.c would. Indeed. > The problem is that the line number is wrong: > /Users/regress/tbox/cvs-gcc/gcc/gcc/testsuite/gcc.dg/pragma-darwin.c:0: > warning: malformed '#pragma options', ignoring^M No wonder, as the caller simply tells the callee to ignore it. Here's a patch that fixes it. I've tested it with the following test file and -Wunknown-pragmas, with and without -save-temps. All warning messages came out at the right spot, and so did the pragmas in the preprocessed output.
Attachment:
t.c
Description: Binary data
Ok to install?
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* cpplib.c (do_pragma): Remove unnecessary cb_line_change.
Index: gcc/cpplib.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cpplib.c,v
retrieving revision 1.350
diff -u -p -r1.350 cpplib.c
--- gcc/cpplib.c 2 Aug 2003 16:29:44 -0000 1.350
+++ gcc/cpplib.c 15 Sep 2003 19:52:08 -0000
@@ -1140,14 +1140,6 @@ do_pragma (cpp_reader *pfile)
}
}
- /* FIXME. This is an awful kludge to get the front ends to update
- their notion of line number for diagnostic purposes. The line
- number should be passed to the handler and they should do it
- themselves. Stand-alone CPP must ignore us, otherwise it will
- prefix the directive with spaces, hence the 1. Ugh. */
- if (pfile->cb.line_change)
- pfile->cb.line_change (pfile, token, 1);
-
if (p)
p->u.handler (pfile);
else if (pfile->cb.def_pragma)
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |