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 other/34200] New: Two compilation units have same private class but no conflict detected or reported.


gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)

I had two c++ files with private classes and other public functions. I linked
them with a third unit of main code (using gcc command line). Now the linker
linked the second compilation unit to the private class in the first
compilation unit not to its private class. The conflict was not detected by GCC
but was detected by MSVC. It result in the program getting SEGV in weird and
incomprehensible ways. The fix was to wrap the private classes in anonymous
namespaces.

Please add detection for this sort of conflicting symbols.


To build compilation unit
g++  -g -O0  -I../../lib_content_adaptor/include CContentPluginExample.cpp -c
-o CContentPluginExample.o

To build executable
g++ -g -O0 -o drivable_plugin drivable_plugin.o CContentPluginExample.o
-L/usr/lib/debug/lib -L../../build/x86/libs -l_content_manager
-l_content_adaptor -l_os -lpthread


-- 
           Summary: Two compilation units have same private class but no
                    conflict detected  or reported.
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mat_geek at yahoo dot com dot au


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


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