Native types can't be used with pointers.
-
- Addict
- Posts: 1550
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Native types can't be used with pointers.
Why is this a fatal error rather than a compiler warning as in case of function CreateGadgetList()?
Why presence of type at the pointer does not allow the code to compile? Prior to version 5.10, it was not a problem, and now a fatal error, with a stop compilation! Why?
Why presence of type at the pointer does not allow the code to compile? Prior to version 5.10, it was not a problem, and now a fatal error, with a stop compilation! Why?
-
- Addict
- Posts: 4791
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Native types can't be used with pointers.
This has already been discussed repeatedly here on the forum.User_Russian wrote:Why is this a fatal error rather than a compiler warning as in case of function CreateGadgetList()?
Why presence of type at the pointer does not allow the code to compile?
-
- Addict
- Posts: 1550
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: Native types can't be used with pointers.
But still not fixed.
It is not an error which requires stopping compilation. This should be a warning.
It is not an error which requires stopping compilation. This should be a warning.
-
- Addict
- Posts: 4791
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Native types can't be used with pointers.
There is nothing to "fix" in this respect.User_Russian wrote:But still not fixed.
You can read more detailed information in the previous discussions here (that's why I mentioned them).
-
- Addict
- Posts: 1550
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: Native types can't be used with pointers.
Why?Fred wrote:No.
Where?Little John wrote:discussions here
Re: Native types can't be used with pointers.
One of the many threads about it, here you can read different opinions on the subject and the reasons behind the changeUser_Russian wrote: Why?
Where?
http://www.purebasic.fr/english/viewtop ... 13&t=52873
"Have you tried turning it off and on again ?"
Re: Native types can't be used with pointers.
For someone who talks about how smart they are, you've never heard of "search"?User_Russian wrote:Where?Little John wrote:discussions here
-
- Addict
- Posts: 1550
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: Native types can't be used with pointers.
But the compiler can such stringconvert toAnd then all will be well.
Why, instead this is error?

I have the same situation as the author, the topic on your link.
Code: Select all
*Point.l
Code: Select all
*Point.long
Why, instead this is error?

In the second post of topic, Fred did not answer.luis wrote:One of the many threads about it, here you can read different opinions on the subject and the reasons behind the change

I have the same situation as the author, the topic on your link.
Code: Select all
Macro LongLong : q : EndMacro
x.LongLong
*y.LongLong
Re: Native types can't be used with pointers.
You couldn't access the quad value on the pointer in a structured way (*y\q doesn't work with native types),User_Russian wrote:I have the same situation as the author, the topic on your link.Code: Select all
Macro LongLong : q : EndMacro x.LongLong *y.LongLong
so you have to use another way.
Code: Select all
Macro LongLong : q : EndMacro
Macro LongLongPtr : Quad : EndMacro
x.LongLong = 12345
*y.LongLongPtr = @x
Debug *y\q
*y = @x
Debug PeekQ(*y)
*y_LongLong = @x
Debug PeekQ(*y_LongLong)
-
- Addict
- Posts: 1550
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: Native types can't be used with pointers.
The use of different types (macro), for variable and pointer, it is "dirty" code!
Above cited the example of automatic type conversion from l to Long.
Above cited the example of automatic type conversion from l to Long.
Re: Native types can't be used with pointers.
It is your choice. You can use:User_Russian wrote:The use of different types (macro), for variable and pointer, it is "dirty" code!
- *x (without any type)
- *x.LongLongPtr
- incorporate the type in the name: *x_LongLong
Use what you want, all 3 options work.
I suggested this, too, back when the change was made. As you can see, it got not changed to this way, as they didn't like it.User_Russian wrote:Above cited the example of automatic type conversion from l to Long.
You are really late. It has all been discussed extensively, and nothing got changed.
They will not change it now, just because User_Russian wants the change. Get used to it.
-
- Addict
- Posts: 1550
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: Native types can't be used with pointers.
This is unacceptable for a paid product! We bought a PB and I think we have the right not to influence its development.Danilo wrote:They will not change it now, just because User_Russian wants the change. Get used to it.
But the development is entirely dependent on the position of Fred and the team. The majority opinion does not mean anything!


Re: Native types can't be used with pointers.
Yes, that's absolutely correct.User_Russian wrote:But the development is entirely dependent on the position of Fred and the team.
- Crusiatus Black
- Enthusiast
- Posts: 389
- Joined: Mon May 12, 2008 1:25 pm
- Location: The Netherlands
- Contact:
Re: Native types can't be used with pointers.
I don't see why this is still a discussion topic. I think it is only logical that this isn't permitted
by the compiler any more. Also, a structure as 'type' for the pointer is logical, because it allows
for accessing the structure fields in that specific block of memory.
I never thought native types on pointers were logical in PureBasic, I mean, it's not like you could
do stuff like this:
In PureBasic. Structured 'types' were always required to do so (.Float)
Anyhow, we all know this is probably not going to change, so why not move on right?
by the compiler any more. Also, a structure as 'type' for the pointer is logical, because it allows
for accessing the structure fields in that specific block of memory.
I never thought native types on pointers were logical in PureBasic, I mean, it's not like you could
do stuff like this:
Code: Select all
float *buffer = (float *)malloc(20);
*(buffer + 10) = 11.52;
Code: Select all
*test.Float = AllocateMemory(20)
*test + 10
*test\f = 11.52