woess...@gmail.com schrieb:
[snip - static const memory asm input]
> Can anyone explain why this works with gcc but not g++?
> 

Because C++ language rules are "different" (to put it nicely) when it comes to
const.
Calling C++ C++ was the worst mistake ever made, it is not C 2.0, it is a
different language where certain aspects of C are totally broken.

In C const is more like a hint/promise (which then may put things into read only
memory, if avail.), while in C++ const is actually a strong guarantee, that
makes the variable an real immediate which does not "exist" anywhere in memory.
It may still exist in memory for technical reasons, but you can not access it,
so you can't pass it into an memory asm input.

You may:
a) filter the const with an #ifndef __cplusplus
b) ask the compiler to put the const into a xmm register for you, beware of
clobbering it (you already did so with the "x" constrain for the other
constants, so why not for this?)
c) does it help if you use the old extern-"C"-trick around the function?

> Thanks in advance,
> Bill

Greetings
        Jan
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
https://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to