On Sat, Sep 17, 2011 at 09:55:47PM +1200, Ralph Versteegen wrote:
> Wow, wonderful, totally cleaned up for option explicit!
> 
> Source files compiled with different dialects can be linked together.
> Previously I've seen fbc throw a warning if you do this, but I don't
> seem to be getting one anymore.
> 
> The reason that it didn't link was indeed name mangling. Only
> overloaded functions use name mangling. The reason that some functions
> get different mangled names is because they are actually different:
> integral parameters which are neither explicitly byref nor byval
> depend on the dialect. If the function is overloaded, then the linker
> notices something is wrong, but if it doesn't, then the code will
> happily link, but will instantly crash on use. I've fixed up the
> overloaded functions which were preventing linking, but doing so was
> pretty pointless (aside from the fact that it had to be done anyway).
> 
> It might be less work to just clean up all files so that they can
> compile with lang fb, and then switch them, rather than adding all the
> explicit byvals/byrefs so that they can be mixed. The danger is that
> by not manually checking each parameter whether it should be byval or
> byref, we will introduce bugs, and that's a certainty.

I have been trying to add byref or byval everywhere. It is usually 
pretty easy for me to tell which one is appropriate, but yes, I probably 
will screw up a few, and depend on bug reports to discover it for me. 
Still, I'll try to be careful. I see the picksave_confirm bug was one of 
that variety.

> I saw something pretty scary when I scanned the diff. I saw that we
> were doing this, but you caught and fixed it:
> 
> EXTERN names() as string
> option dynamic
> dim names(30)
> 
> Turns out that this DID work correctly in lang deprecated. Odd.

Ah, yes! I am intending to fix all DIM arrayname() to REDIM arrayname() 
since that seems to be correct in every situation. 

> On 17 September 2011 08:48,  <[email protected]> wrote:
> > james
> > 2011-09-16 13:48:30 -0700 (Fri, 16 Sep 2011)
> > 198
> > game.bas can now be compiled with -lang fb
> > (although we don't actually do this yet because apparently you can't link 
> > object files from fb an deprecated together (because of name mangling, I 
> > think))
> > ---
> > U   wip/allmodex.bi
> > U   wip/bmod.bi
> > U   wip/bmodsubs.bi
> > U   wip/common.bas
> > U   wip/common.bi
> > U   wip/game.bas
> > U   wip/game.bi
> > U   wip/menus.bi
> > _______________________________________________
> > Ohrrpgce mailing list
> > [email protected]
> > http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
> >
> _______________________________________________
> Ohrrpgce mailing list
> [email protected]
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
> 
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to