Re: Re[2]: [9fans] Strange 'uintptr' behavior

2022-01-25 Thread Pavel Klinkovský
Ah, thanks! Going to try...

út 25. 1. 2022 v 9:28 odesílatel Alex Musolino  napsal:

> It didn't always work on 9front.  Check the dump!
> 
> After bisecting the dump and looking through the git log, I suspect
> that 9front changeset 71939a82 [1] will fix it for you.
> 
> [1]
> https://git.9front.org/plan9front/plan9front/71939a82ccc505b0baa990d7fe17e7085d0ab8fc/commit.html
> 

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tb5fe0dc43447ab2c-Ma557fc25c99094fa66c5fa53
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re[2]: [9fans] Strange 'uintptr' behavior

2022-01-25 Thread Alex Musolino
It didn't always work on 9front.  Check the dump!

After bisecting the dump and looking through the git log, I suspect
that 9front changeset 71939a82 [1] will fix it for you.

[1] 
https://git.9front.org/plan9front/plan9front/71939a82ccc505b0baa990d7fe17e7085d0ab8fc/commit.html


--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tb5fe0dc43447ab2c-M7ca511b172875758e866dd78
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re[2]: [9fans] Strange 'uintptr' behavior

2022-01-25 Thread Alexandr Babic

i've tried it again and i can compile both versions 1) and 2) without error at 
9front distro of plan9.
do you use original 4th release of plan9 or 9front distro?

download link of 9front iso: 
http://9front.org/iso/9front-8593.acc504c319a4b4188479cfa602e40cb6851c0528.amd64.iso.gz

1)

#include 
#include 

uintptr frst[] = {nil, nil, nil, nil, nil};
uintptr scnd[] = {nil, nil, frst, [1]};

void main(void) {
exits(nil);
}

2)
#include 
#include 

void* frst[] = {nil, nil, nil, nil, nil};
void* scnd[] = {nil, nil, frst, [1]};

void main(void) {
exits(nil);
}
 Permalink


--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tb5fe0dc43447ab2c-Mb9de3c2d80c775bfb636982d
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] Strange 'uintptr' behavior

2022-01-24 Thread Pavel Klinkovský
Sorry, I was not precise enough.
I prepared arrays in the initiated data segment:


This program cannot be compiled:

#include 
#include 

uintptr frst[] = {nil, nil, nil, nil, nil};
uintptr scnd[] = {nil, nil, frst, [1]};

void main(void) {
exits(nil);
}

...because of:

cpu% 5c t.c
t.c:5 initializer is not a constant: scnd


This program can be compiled:

#include 
#include 

void* frst[] = {nil, nil, nil, nil, nil};
void* scnd[] = {nil, nil, frst, [1]};

void main(void) {
exits(nil);
}

Pavel

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tb5fe0dc43447ab2c-M55c6dc11d2315bac025e3124
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] Strange 'uintptr' behavior

2022-01-24 Thread Skip Tavakkolian
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 
#include 

void
main(int argc, char **argv)
{
#ifdef USEUINTPTR
uintptr frst[] = {nil, nil, nil, nil, nil};
uintptr scnd[] = {nil, nil, frst, [1]};
uintptr thrd[] = {nil, nil, frst, [0]};
#else
void* frst[] = {nil, nil, nil, nil, nil};
void* scnd[] = {nil, nil, frst, [1]};
void* thrd[] = {nil, nil, 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ý
 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, [0]};
>
> But this one fails:
> uintptr frst[] = {nil, nil, nil, nil, nil};
> uintptr scnd[] = {nil, nil, 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, [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


Re: [9fans] Strange 'uintptr' behavior

2022-01-24 Thread Alexandr Babic
hi.

i inluded them too, but had that error with uintptr.
i tried it with 6c, 5c and had same result.

(9front installation of plan9)

a.b.



24. ledna 2022 20:49:30 SEČ, "Pavel Klinkovský"  
napsal:
>> what headers you've included?
>>
>
>As usually:
>
>#include 
>#include 
>
>
>with uintptr i get compilation error: incompatible types: "ULONG" and "IND
>> VOID" for op AS.
>> with void* it compiles without errors.
>>
>> alex.b.
>>
>> ps: are you czech?
>>
> 
> Yes.
> 
> Pavel

-- 
Odesláno aplikací K-9 Mail ze systému Android. Omluvte prosím moji stručnost.
--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tb5fe0dc43447ab2c-M5c331b90faf1d97a6d872bb8
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] Strange 'uintptr' behavior

2022-01-24 Thread Pavel Klinkovský
> what headers you've included?
>

As usually:

#include 
#include 


with uintptr i get compilation error: incompatible types: "ULONG" and "IND
> VOID" for op AS.
> with void* it compiles without errors.
>
> alex.b.
>
> ps: are you czech?
>

Yes.

Pavel

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tb5fe0dc43447ab2c-Mfd55c3e288c7cbeeafb039f5
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] Strange 'uintptr' behavior

2022-01-24 Thread Alexandr Babic

hello.

what headers you've included?
with uintptr i get compilation error: incompatible types: "ULONG" and "IND 
VOID" for op AS.
with void* it compiles without errors.

alex.b.

ps: are you czech?


--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tb5fe0dc43447ab2c-M782b57a9678ac27bcd643f48
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


[9fans] Strange 'uintptr' behavior

2022-01-24 Thread Pavel Klinkovský
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, [0]};

But this one fails:
uintptr frst[] = {nil, nil, nil, nil, nil};
uintptr scnd[] = {nil, nil, 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, [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