Pelles C forum

Pelles C => Bug reports => Topic started by: frankie on November 04, 2004, 02:01:46 PM

Title: POCC stdcalls decoration
Post by: frankie on November 04, 2004, 02:01:46 PM
Hi Pelle,
I just installed the last revision and I had a problem with the symbol's decoration in __stdcall functions. The compiler switch to avoid decoration doesn't work, and there is no way to remove them. This makes impossible to call __stdcall functions from assembler (unless you provide decoration on the assembler side, that is not supported in all assemblers).
Of course the version 2.80 of the compiler works fine.
Regards
F.
Title: POCC stdcalls decoration
Post by: Pelle on November 05, 2004, 11:30:14 AM
Hello,

The -Gn option was only meant to provide a simpler way to export undecorated symbols. Version 2.80 was buggy, since it tried to undecorate *all* __stdcall symbols, which caused problems -for example- when trying to call __stdcall symbols from import libraries (with decorated names). This have been fixed in 2.90.

If you want *all* __stdcall symbols to be undecorated, I guess I have to add a new options for that. It makes no sense in the 'C' world, but I understand it can be useful in the 'assembly' world.

Pelle
Title: POCC stdcalls decoration
Post by: frankie on November 08, 2004, 12:39:47 PM
Hello Pelle,
actually I (and people that use your compiler system as well for low level or OS independent code that mixes C and assembler) cannot use the last version of compiler.
As I immagine your are interested in that your compiler could be used in any application field I think you should provide a switch to undecorate **all** symbols to allow such a large applicability.
Moreover should you no more support symbols undecoration all sw already write could no more be mantained or modified unless using old 2.80.
Thank you
Regards
F.
Title: POCC stdcalls decoration
Post by: Pelle on November 08, 2004, 01:02:41 PM
Have you looked at 2.90.1 ??????

Pelle
Title: POCC stdcalls decoration
Post by: frankie on November 08, 2004, 02:07:26 PM
Sorry Pelle,
but I don't have such a release (I just collected 2.90.11 and the actual 2.90.17).
Where can I get it?
Regards
F.
Title: POCC stdcalls decoration
Post by: Pelle on November 08, 2004, 02:37:12 PM
You find it here right now (use the new -Gm option):
http://smorgasbordet.com/phpBB2/viewtopic.php?t=225

Pelle
Title: POCC stdcalls decoration
Post by: frankie on November 08, 2004, 03:23:24 PM
Ok Pelle,
thanks, the new switc /Gm works fine, only optimization with switch /Ox has problem in my code (I get a triple fault in CPU). I'll check as soon I can what's the reason and let you know. Optimization with /Os works.
Regards
F.
Title: POCC stdcalls decoration
Post by: Vortex on November 09, 2004, 06:41:28 PM
Hi frankie,

Which is the assembler you are using currently?
Title: POCC stdcalls decoration
Post by: frankie on November 10, 2004, 11:11:38 AM
Hi Vortex
I generally use nasm.
Title: POCC stdcalls decoration
Post by: Vortex on November 10, 2004, 05:33:09 PM
Hi frankie,

Nasm, can it use internally decorated names?
Title: POCC stdcalls decoration
Post by: frankie on November 11, 2004, 12:41:17 PM
Hi Vortex,
I don't think the netwide assembler use these gadgets, anyway there will be always another compiler or assembler that don't use them making difficult the mixed language programming.
I.e. MS suggest to modify the .def file for libraries to create aliases for symbols where you don't want decoration, introducing some kind of manual work on compilink/linking process, and only useful for dll's.
So it's better to have the option to remove them, and moreover could be useful to have switch that avoid the undescore decoration for C symbols, in this case with the __stdcall attribute and capital letters name a function is perfectly PASCAL compatible.
Regards
F.