9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Strange 'uintptr' behavior
@ 2022-01-24 16:50 Pavel Klinkovský
  2022-01-24 19:33 ` Alexandr Babic
  2022-01-24 22:26 ` Skip Tavakkolian
  0 siblings, 2 replies; 9+ messages in thread
From: Pavel Klinkovský @ 2022-01-24 16:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

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
Permalink: https://9fans.topicbox.com/groups/9fans/Tb5fe0dc43447ab2c-M240dd4253f2ea03efc2d9013
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 1606 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-01-25  8:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-24 16:50 [9fans] Strange 'uintptr' behavior Pavel Klinkovský
2022-01-24 19:33 ` Alexandr Babic
2022-01-24 19:49   ` Pavel Klinkovský
2022-01-24 19:54     ` Alexandr Babic
2022-01-24 22:26 ` Skip Tavakkolian
2022-01-25  7:48   ` Pavel Klinkovský
2022-01-25  8:02     ` Re[2]: " Alexandr Babic
2022-01-25  8:26       ` Alex Musolino
2022-01-25  8:33         ` Pavel Klinkovský

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).