public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/36674]  New: #include location is offset by one row in errors from preprocessed files
@ 2008-06-29 21:45 antalk at chello dot hu
  2009-02-08 15:56 ` [Bug c/36674] " manu at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: antalk at chello dot hu @ 2008-06-29 21:45 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1694 bytes --]

Given
--- main.h ---
not_declared_yet();
--- main.c ---
#include "main.h"
--- Makefile ---

all:
        gcc --version
        gcc -Wall -E -I.  main.c > huhu.ii
        -gcc -Wall  -I.  huhu.ii
        gcc -Wall  -I.  main.c
----

make produces:
-------------------
make 
gcc --version
gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gcc -Wall -E -I.  main.c > huhu.ii
gcc -Wall  -I.  huhu.ii
In file included from main.c:2:
main.h:1: error: expected constructor, destructor, or type conversion before
‘;’ token
make: [all] Error 1 (ignored)
gcc -Wall  -I.  main.c
In file included from main.c:1:
main.h:1: warning: data definition has no type or storage class
main.h:1: warning: type defaults to ‘int’ in declaration of
‘not_declared_yet’
...(truncated)
-------------------

That is 'In file included from main.c:2:' instead of main.cc:1: when 
the file is preprocessed first.

---- huhu.ii contains ---
# 1 "main.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "main.c"
# 1 "main.h" 1
not_declared_yet();
# 1 "main.c" 2
-------------------------


-- 
           Summary: #include location is offset by one row in errors from
                    preprocessed files
           Product: gcc
           Version: 4.2.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: antalk at chello dot hu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36674


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c/36674] #include location is offset by one row in errors from preprocessed files
  2008-06-29 21:45 [Bug c/36674] New: #include location is offset by one row in errors from preprocessed files antalk at chello dot hu
@ 2009-02-08 15:56 ` manu at gcc dot gnu dot org
  2009-05-13 23:18 ` [Bug preprocessor/36674] " manu at gcc dot gnu dot org
  2009-05-13 23:20 ` manu at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: manu at gcc dot gnu dot org @ 2009-02-08 15:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from manu at gcc dot gnu dot org  2009-02-08 15:56 -------
Patch http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00875.html


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2008-
                   |                            |10/msg00875.html
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |patch
   Last reconfirmed|0000-00-00 00:00:00         |2009-02-08 15:56:03
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36674


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug preprocessor/36674] #include location is offset by one row in errors from preprocessed files
  2008-06-29 21:45 [Bug c/36674] New: #include location is offset by one row in errors from preprocessed files antalk at chello dot hu
  2009-02-08 15:56 ` [Bug c/36674] " manu at gcc dot gnu dot org
@ 2009-05-13 23:18 ` manu at gcc dot gnu dot org
  2009-05-13 23:20 ` manu at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: manu at gcc dot gnu dot org @ 2009-05-13 23:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from manu at gcc dot gnu dot org  2009-05-13 23:18 -------
Subject: Bug 36674

Author: manu
Date: Wed May 13 23:17:55 2009
New Revision: 147504

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147504
Log:
2009-05-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

        PR cpp/36674
libcpp/
        * directives (do_linemarker): Compensate for the increment in
        location that occurs when we reach the end of line.
        * files (_cpp_stack_include): Mention _cpp_find_file in the
        comment.
testsuite/
        * gcc.dg/cpp/pr36674.i: New.

Added:
    trunk/gcc/testsuite/gcc.dg/cpp/pr36674.i
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/libcpp/ChangeLog
    trunk/libcpp/directives.c
    trunk/libcpp/files.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36674


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug preprocessor/36674] #include location is offset by one row in errors from preprocessed files
  2008-06-29 21:45 [Bug c/36674] New: #include location is offset by one row in errors from preprocessed files antalk at chello dot hu
  2009-02-08 15:56 ` [Bug c/36674] " manu at gcc dot gnu dot org
  2009-05-13 23:18 ` [Bug preprocessor/36674] " manu at gcc dot gnu dot org
@ 2009-05-13 23:20 ` manu at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: manu at gcc dot gnu dot org @ 2009-05-13 23:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from manu at gcc dot gnu dot org  2009-05-13 23:19 -------
FIXED in GCC 4.5


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36674


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-05-13 23:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-29 21:45 [Bug c/36674] New: #include location is offset by one row in errors from preprocessed files antalk at chello dot hu
2009-02-08 15:56 ` [Bug c/36674] " manu at gcc dot gnu dot org
2009-05-13 23:18 ` [Bug preprocessor/36674] " manu at gcc dot gnu dot org
2009-05-13 23:20 ` manu at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).