An odd code case that was reported via https://github.com/z88dk/z88dk/issues/2291
Code (much reduced):
const int foo[] = {42,43,44,45,46,47};
extern const int foo[];
int main(void)
{
return 0;
}
Compiler: SDCC : z80/z180/r2ka/r3ka/sm83/ez80_z80/z80n TD- 4.3.0 #14110 (Mac OS X x86_64) (and earlier versions)
Compile line: sdcc -S -mz80 blah.c
Results in:
blah.c:4: error 91: extern definition for 'foo' mismatches with declaration.
blah.c:2: error 177: previously defined here
Other compilers accept without complaint.
I can reproduce the issue using an SDCC built from current trunk on Debian GNU/Linux testing on amd64.
Fixed in [r14247].
Related
Commit: [r14247]
Last edit: Philipp Klaus Krause 2023-07-29