1: Sample code that reproduces the problem.
struct S { int x; };
void h(struct S s, int t)
{
s = t;
}
void i(struct S s, int t)
{
1 ? s : t;
}
2: Exact command used to run SDCC on this sample code
sdcc -mz80 bug.c
3: SDCC version tested
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/r4k/r5k/r6k/sm83/tlcs90/ez80/z80n/r800/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502/mos65c02/huc6280/f8/f8l TD- 4.6.4 #16997 (Linux)
4: Copy of the error message or incorrect output, or a clear description of the observed versus expected behavior.
<source>:6: error 47: indirections to different types assignment
from type 'int auto'
to type 'struct S auto'
<source>:11: error 47: indirections to different types conditional operator
from type 'int auto'
to type 'struct S auto'
Compiler returned: 1
See https://godbolt.org/z/an6cMMW97
Neither statement exercises any kind of indirection, and simply appending "assignment" or "conditional operator" is ungrammatical.
There is also a third use of the same error message template in
createIvalCharPtrbut I have not yet discovered how to provoke it:A fix for this bug would need to include an audit of all uses of the error code.
Last edit: Christopher Bazley 2 days ago