Menu

#803 anon namespaces can collide

open
nobody
None
compiler
2015-12-27
2015-12-26
dkl
No

Anonymous namespaces are given an auto-generated name, but currently this isn't unique enough. For example, take two .bas modules, both containing this:

namespace
    sub f()
    end sub
end namespace

It gives a linker error:

$ fbc 3.bas 4.bas 
4.o: In function `.LT_0004::F()':
(.text+0x0): multiple definition of `.LT_0004::F()'
3.o:(.text+0x0): first defined here

http://www.freebasic.net/forum/viewtopic.php?p=176830#p176830

Discussion

  • dkl

    dkl - 2015-12-26
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -11,3 +11,5 @@
         4.o: In function `.LT_0004::F()':
         (.text+0x0): multiple definition of `.LT_0004::F()'
         3.o:(.text+0x0): first defined here
    +
    +http://www.freebasic.net/forum/viewtopic.php?p=176830#p176830
    
     

Log in to post a comment.