Am 24.02.22 um 17:54 schrieb Sebastian 'basxto' Riedel:
On 24.02.22 14:22, Basil Hussain wrote:
I would assume both, as the attribute concerns not only how the
function is to be called by other code, but also affects how SDCC
generates code to access args within the function.
You should need it for both, once in the .c file for compiling the
function and once in the .h, so that other object files can call it
correctly.
And SDCC should tell you:
void f(void) __sdcccall(0);
void f(void)
{
}
philipp@notebook6:/tmp$ ~/sdcc-trunk/sdcc/bin/sdcc -mstm8 test.c
test.c:3: error 98: conflict with previous declaration of 'f' for
attribute 'type' at test.c:1
from type 'void function ( ) __sdcccall(1) fixed'
to type 'void function ( ) fixed'
Actually, the error message is could be better here, as it should have
the __sdccall(1) explicit, and the other one implicit, like in the code,
but at least there is an error.
Philipp
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user