I am new with sdcc and I can't find a solution for these errors.
Error 159: in function write_register: name omitted for parameter 2
error 16: variable ´_write_register_PARM_2' must be static to have storage class in reentrant function
I am trying to write a function with 2 parameters which uses the parameters that I passed it. What should I do?
Thanks and regards
can you write you code here?
This is my code:
void write_register(BYTE register_name, BYTE data)
main.c:155: parse error: token -> 'BYTE' ; column 5
main.c:156: parse error: token -> 'data' ; column 7
main.c:163: error 159: in function write_register: name omitted for parameter 2
main.c:163: error 16: variable '_write_register_PARM_2' must be static to have storage class in reentrant function
BYTE is not defined. You should define like this before using:
typedef unsigned char BYTE;
'data' is reserved keyword in SDCC: change second parameter name (to 'value' for example).
I would fix the first error first. Apparently you did not define BYTE.
Next 'data' is a reserved keyword for SDCC for some targets unless --std-c89 or --std-c99 is used.
Finally you might have missed --stack-auto while compiling one of your source files.
It seems to work properly now