View Single Post
Old 06 January 2023, 16:10   #12
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,510
Arcanist is right.
<proto/...>
is the way to go. It makes sure that all prototypes and compiler specific enhancements (like pragmas, inlines) are included. Never include some
<inline[s]/..>
or
<pragma[s]/...>
file directly, as it makes your source compiler-specific.
Include
<clib/...>
instead of
<proto/...>
if you absolutely want, for whatever reason, to use stub routines from amiga.lib to call OS functions and avoid inline calls.

Quote:
Originally Posted by Thomas Richter View Post
Thomas' second solution based on va_start is the correct one "by the letter",
It may work with most AmigaOS/68k compilers, but I wouldn't call it correct.
You shouldn't cast a va_list to some pointer. A va_list can be anything. For example a complex structure, for ABIs using arguments in registers, like PPC.

Quote:
even though it is for most (all?) Amiga compilers equivalent to the first.
Not sure. Maybe there are gcc ports with a broken standard ABI (passing arguments in registers by default)?
phx is offline  
 
Page generated in 0.08267 seconds with 11 queries