Native types can't be used with pointers.

Just starting out? Need help? Post your questions and find answers here.
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Native types can't be used with pointers.

Post by luis »

User_Russian wrote:
luis wrote:One of the many threads about it, here you can read different opinions on the subject and the reasons behind the change
In the second post of topic, Fred did not answer. :?
I didn't say the explanations were coming from Fred in that thread, but the reasons behind are explained nevertheless, isn't that enough for you ?
http://www.purebasic.fr/english/viewtop ... 47#p400747

About converting it automatically:
The point is the compiler should never had allowed that in the first place. Doing some kind of automatic correction would permit people to still use that wrong syntax, maybe posting it in the forum because it's still working anyway etc. Better cut it off.

About using a warning:
PB uses warning to warn you to replace deprecated commands, commands that were legitimate but were replaced/changed in some way.
They are in fact still supported but that can change, so the warning.
Permitting the use of native types in pointer was just an oversight, it was never intended to be used, it was never legitimate. It was an error and it needed to be corrected because some people used that syntax, without a meaning, just because it was possible. The only use was a kind of cosmetic remark with no effect at all on the generated ASM code. *p.b, *p.l, *p.w, etc are all the same thing as *p because the type has no effect.
Specifying the type of a pointer (not a structured pointer) was and it's meaningless. You can't have a pointer of type byte.
And that code floating around was giving the wrong message to new users approaching the PB pointer's syntax. It had to be eradicated.

It's not the first time PB changes in some way and you have to update your sources, so do as usual.
Update your code and move on, it's just a search and replace.
I never used the meaningless syntax for the reasons explained before so for me the change was totally painless :)
"Have you tried turning it off and on again ?"
User avatar
Crusiatus Black
Enthusiast
Enthusiast
Posts: 389
Joined: Mon May 12, 2008 1:25 pm
Location: The Netherlands
Contact:

Re: Native types can't be used with pointers.

Post by Crusiatus Black »

luis wrote:The only use was a kind of cosmetic remark with no effect at all on the generated ASM code. *p.b, *p.l, *p.w, etc are all the same thing as *p because the type has no effect.
Therefore accidental syntactic sugar, which one should not rely on. Good explanation
Image
Bas Groothedde,
Imagine Programming

I live in a philosophical paradoxal randome filled with enigma's!
Post Reply