[OpenWalnut-Dev] duplicate class names

Mario Hlawitschka hlawitschka at informatik.uni-leipzig.de
Thu Oct 7 16:52:21 CEST 2010


Hi,

the compiler cannot check because the collision happens at runtime when loading the different libraries. It usually checks within the same library and reports errors there.
It should be the dynamic linker that checks, and they tend to be amazingly lazy... (and highly platform-dependent)

	Mario

On Oct 7, 2010, at 2:16 AM, Christian Heine wrote:

> Hi,
> 
> according to the one definition rule of C++, the program is invalid in the presence of two different classes with the same name. The compiler/linker *must* check for it. Why they do not is mysterious.
> 
> Which class is it btw.?
> 
> Christian
> 
> On 10/06/10 19:37, Ralph Schurade wrote:
>> Hello All,
>> 
>> today i was hunting down a bug/crash that didn't make sense at all.
>> In the end i found out it was because someone created a class (in common)
>> with the same name as one that was already in use in the module in question.
>> Now the compiler and linker obviously had no problem with that, not even
>> a warning, but it crashed at runtime.
>> 
>> So the question here is, how to avoid this? Can we tweak the stylechecker
>> to look for something like that? Namespaces? Even though we don't like them.
>> 
>> Opinions?
> _______________________________________________
> OpenWalnut-Dev mailing list
> OpenWalnut-Dev at lists.informatik.uni-leipzig.de
> http://lists.informatik.uni-leipzig.de/mailman/listinfo/openwalnut-dev



More information about the OpenWalnut-Dev mailing list