Compiling a function returning a function pointer
typedef void l_fptr_1(void);
l_fptr_1 *dosub(void);
l_fptr_1 *dosub(void)
{
return 0;
}
is broken in sdcc 3.6.3 #9791 (I tired stm8, mcs51, z80):
test.cbe.c:6: error 98: conflict with previous definition of 'dosub' for attribute 'type'
from type 'void function ( ) code* function ( ) fixed'
to type 'void function ( ) generic* function ( ) fixed'
Philipp
This issue prevents compilation of current NuttX with current SDCC.
In particular sigset() from libc/signal/sig_set.c.
Philipp
It seems function declarations are first checked against previous declarations, then processed in addSymChain(). The "code" seems to get added somewhere in addSymChain (it is not there at the beginning of addSymChain(), but is there when addSym() is called. Thus at the second declaration, at the check, the first declaration already has the code added, but the second does not, so there is a mismatch.
Philipp
P.S.: It seems the change is happening in changePointer(), called from addSymChain().
Last edit: Philipp Klaus Krause 2017-10-08
Fixed in revision [r10039].
Philipp