This is the mail archive of the gcc-bugs@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]

[Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C.


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: GCC 3.3 C++ for Sparc Solaris assumes system header
                    files are C.
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: numien at deathwyrm dot net
                CC: gcc-bugs@gcc.gnu.org

I noticed this problem first with GCC 3.2.3, upgraded to the latest build I
could get to compile (3.3), and it still exists. It only seems to appear on
Sparc Solaris, I could not reproduce it on any other platform, including Sparc
Linux.

Essentially, it appears any header file included as "#include <header>" is
assumed to be C, even when included in C++ (.cc, .C, .cpp all tested) code. This
causes errors if function overloading is used.

I reproduced the problem with a very simple test, one header file in
/usr/include containing an overloaded function definition, and a C++ main that
only includes the header and returns 1. The .ii file looks correct, but on
compile it complains that declaration of C function `int test(int, int)'
conflicts with `int test(int)'.

Your bug reporting guidelines specify to include the preprocessed .ii file, but
I don't see any method of attaching a file here. If one would be helpful, please
feel free to e-mail me.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]