maybe a previous fix was not applied? there is a slight difference in the error messages between the address of zeroth element vs first element (see line 9 vs 10 errors below). regardless, it's working as expected on vanilla Plan 9:
% cat addrgames.c #include <u.h> #include <libc.h> void main(int argc, char **argv) { #ifdef USEUINTPTR uintptr frst[] = {nil, nil, nil, nil, nil}; uintptr scnd[] = {nil, nil, frst, &frst[1]}; uintptr thrd[] = {nil, nil, frst, &frst[0]}; #else void* frst[] = {nil, nil, nil, nil, nil}; void* scnd[] = {nil, nil, frst, &frst[1]}; void* thrd[] = {nil, nil, frst, &frst[0]}; #endif exits(""); } % 8c addrgames.c % 5c addrgames.c % vc addrgames.c % 6c addrgames.c % 5c -D USEUINTPTR addrgames.c addrgames.c:8 incompatible types: "ULONG" and "IND VOID" for op "AS" addrgames.c:8 incompatible types: "ULONG" and "IND VOID" for op "AS" addrgames.c:8 incompatible types: "ULONG" and "IND VOID" for op "AS" addrgames.c:8 incompatible types: "ULONG" and "IND VOID" for op "AS" addrgames.c:8 incompatible types: "ULONG" and "IND VOID" for op "AS" addrgames.c:9 incompatible types: "ULONG" and "IND VOID" for op "AS" addrgames.c:9 incompatible types: "ULONG" and "IND VOID" for op "AS" addrgames.c:9 incompatible types: "ULONG" and "IND ULONG" for op "AS" addrgames.c:9 incompatible types: "ULONG" and "IND ULONG" for op "AS" addrgames.c:10 incompatible types: "ULONG" and "IND VOID" for op "AS" addrgames.c:10 incompatible types: "ULONG" and "IND VOID" for op "AS" too many errors On Mon, Jan 24, 2022 at 8:51 AM Pavel Klinkovský <pavel.klinkov...@gmail.com> wrote: > > Hi all, > > I tried some artificial example for Plan9 compiler (5c)... > > This code is compiled without any problem: > uintptr frst[] = {nil, nil, nil, nil, nil}; > uintptr scnd[] = {nil, nil, frst, &frst[0]}; > > But this one fails: > uintptr frst[] = {nil, nil, nil, nil, nil}; > uintptr scnd[] = {nil, nil, frst, &frst[1]}; > > ...with message: > cpu% 5c -p t.c > /usr/pavel/t.c:16[t.c:888] initializer is not a constant: scnd > > OTOH, replacement of 'uintptr' by 'void*' is compiled without any problem: > void* frst[] = {nil, nil, nil, nil, nil}; > void* scnd[] = {nil, nil, frst, &frst[1]}; > > Any explanation is appreciated. > > Pavel > > 9fans / 9fans / see discussions + participants + delivery options Permalink ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tb5fe0dc43447ab2c-M7fd1679cf965fc15eaceaa47 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription