Changes between Version 9 and Version 10 of Faq
- Timestamp:
- Sep 9, 2006, 11:19:35 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Faq
v9 v10 31 31 === What's the story with the underscore? === 32 32 33 The extra underscore can be said to be inherited from the microsoft compilers, which makes it go back to the early DOS days. [If somebody has a complete history, please update/let me know. bird]33 The extra underscore can be said to be inherited from the microsoft compilers, which makes it go back to the early DOS days. But it's older than this. It actually goes back to the childhood of C and UNIX. John R. Levine's book "Linkers and Loaders" has a section "Simple C and Fortran name mangling" in chapter 5 which attempts to explain it all: http://www.iecc.com/linker/linker05.html (It's an excellent book btw.) 34 34 35 35 The OS/2 (and Windows) C ABI (application binary interface) dicates that the {{{__cdecl}}} calling convention shall decorate functions with one leading underscore. To my knowledge most of the windows and OS/2 compilers with the exception of EMX does this. The OS/2 specific {{{_System}}} calling convention is basically the same as {{{__cdecl}}} except that there is no decoration of the function name (there is also the bit about AL containing the parameter count, but nobody really implements this). There are a number of other calling convetions on OS/2, {{{_Optlink}}} (the IBM compilers), watcom register call (todo: name), {{{__stdcall}}} (microsoft windows api), borland probably has one, etc...