Thus you've run into a bug in the 2.95.x C++ parser. Bad luck.I have 2.95.3-kgpd on Mac, Windoze and Lunix so at least my environment is consistent!
Dare I say that I thought it might be a bug, but having read all the 'docs'
about casting aspersions elsewhere before getting your own house in order,
one does not make such accusations lightly! That and years in the job have always led me to believe it's all my fault. *8-) That's why I asked for guru level feedback. I became *very* suspicious about it when adding "g"(0) made it 'go away'. As if it were 'the other style'!!!!
The *only* other time I've ever found a bug in a compiler was with Visual C++ a few years back. It was to do with C++ namespaces and basically the compiler just plain hung up! I got the expected level of response from MS as well. Zilch.
Thanks for your very clear and detailed reply. It's never ceases to amaze me just how useful these list thingies are at times. People should appreciate them more then they do. I've yet to meet *any* commercial support scheme that has so much breadth and variety.
I have taken the 'obvious' way out, for me anyway, and moved it all into .S files and put m68k-palmos-as into the food chain! At least I know where I am! The parameter passing has obv. taken a dive in readability but no more hassles!Yes, it's a pain to decide whether your asm() for today is going to be old-style or extended and thus how many percent signs to put in it.
Agreed! Was it Lincoln who said: "You can fool some of the compilers all of the time and all of the comilers some of the time, but you can't fool all of the compilers all of the time"? Actually, I think it was me.Therefore in practice what I do is always use extended asm()s and always list some clobbers and usually operands too. If you're not listing any operands or clobbers, 99% of the time it's because you're lying to the compiler. You don't want to do that.
For example, your POPALLNOTA7I did end up doing that. Basically, I've written the mother of all blitters and some special effects routines, fire effects etc etc. They now sit happily in .S files. I have learned! I am going to bone up on 'clobbers' once and for all!!!
#define POPALLNOTA7 asm("movem.l (%%sp)+, %%d0-%%d7/%%a0-%%a6" : : )
clobbers practically all the registers, but you haven't told the compiler that. If you do bother to tell the compiler, then
(1) it will be able to generate correct code around your asm() instead of potentially generating broken code [1];
(2) you will have no "is this old or extended" syntactic problems.
In practice what I also find is that my inline asm() template texts don't contain many explicitly named registers. Rather, they're full of %0, %1, etc, and I let the compiler take care of the boring work of allocating and loading the registers. It's the computer, after all.
If you are writing great screeds of entire asm subroutines with explicit hand-allocated register manipulation, probably you want to be using a separate assembler source file (foo.s) rather than inline asm.
You owe the Oracle one lightly roasted parsnip.No problem. Honey roasted to be precise. You can either have the low calorie (as a PNG file attached) version or, provide me with a snail mail address and I'll send you some in the post with a special Guru Style sauce,
secret ingredient is mashed GCC manual pages reduced with red wine.
Sean Charles.
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
