From: "Pavel Klinkovský" <pavel.klinkovsky@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] Strange 'uintptr' behavior
Date: Mon, 24 Jan 2022 17:50:28 +0100 [thread overview]
Message-ID: <CAGNd-2PeH=+_49O8eQSoCbOvExW8Nr8J9efcJVe9XMv8onHEcQ@mail.gmail.com> (raw)
[-- 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 --]
next reply other threads:[~2022-01-24 16:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 16:50 Pavel Klinkovský [this message]
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ý
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGNd-2PeH=+_49O8eQSoCbOvExW8Nr8J9efcJVe9XMv8onHEcQ@mail.gmail.com' \
--to=pavel.klinkovsky@gmail.com \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).