Open Baron-von-Riedesel opened 7 months ago
-ecc option change calling convention and part of this is name change in object file. If you want only change the symbol name you need not use -ecc option. You can use following construct to define real symbol for C/C++ symbol with prefixed underscore characters.
#pragma aux asmfunc "_*"
-ecc option change calling convention and part of this is name change in object file.
Are you sure about that? I've got the impression that options -3s/4s/5s or -3r/4r/5r actually determine the calling convention - while the -ecc option affects the name only.
The #pragma hack is ok, but still, the C++ compiler should not emit such strange error messages just because option -ecc is given. I noticed, however, that this bug report is more or less a double, there's already #1187
Yes, the problem with the -ec... options for C++ compiler is known. But -ecc not only changes the name, but also changes the passing of parameters from the registers to the stack. -ecc is similar to -3s, but not the same. anyway, the -3r option passes the parameters through the registers. Combining -3r or -3s with any -ec.. option is inherently nonsense and can lead to unpredictable behavior. You should use either the -ec... or -3r or -3s option. Now -3r or -3s is for backwards compatibility because -ec... handles things correctly. Anyway by #pragma aux you can define default convention for parameter passing and naming etc. it can do same thing as -3r or -3s or any -ec.. option because internaly these options manipulate with default convention. generaly #pragma aux can handle any feature of calling convention but -ec.. or -3s or -3r are limited to specific cases.
The error may be emitted by the C++ compiler wpp386 if your C++ code contains a std include file, i.e. math.h:
it happens only if the compiler option -ecc is given, though. This option is needed here to make the compiler add a preceding underscore to the external ( _asmfunc ).