Adriaan van Os wrote:
I don't see a reason why a conversion from a pointer to an integer type is "too fragile".
Because pointer and integer types can have different sizes on different platforms. We've had this argumment before. The compatibility of parameters would then vary from system to system.
If the compiler checks the sizes, the only risk is an error messages when sizes ever change. Yes, I agree that it is not "good style" for platform independent code, but even then the decision is up to the programmer.
Bogus argument that can be used to support any crappy feature.
I tried to find a constructive solution, but if it's "all or nothing" to you, including unsafe pointer-integer conversions, I don't think we'll reach a solution.
I value that GPC is great for writing platform-independent code, but we have to be realistic too. As of today, this only applies to non-GUI programs.
No, it doesn't.
As soon as you start to write GUI applications, the software is heavily dependent on the OS and platform-independence is no longer an argument, because you have made a decision beforehand on what platforms the software should run.
You've seen no portable GUI software yet? AFAIK, there's even X11 for Windows by now. Not to mention portable GUI toolkits such as Qt ...
It will be dependent on the OS probably if you write it the Windows or Mac way, but Unix GUIs have few special OS dependencies.
And if we could restrict it to pointers, do I get it right that the routine externally behaves as if the parameter were an untyped pointer (i.e., `Pointer' in BP and GPC), and internally the pointer is converted to the given type before the routine starts?
There is also the unfortunate case (discussed long ago) where an untyped 'Pointer' parameter of a formal procedural parameter is rejected by the compiler when the corresponding pointer parameter of the actual procedural parameter is typed.
For var-parameters, this is?
Isn't at least -O1 required when checking for unused parameters (etc.)
No, for using unintialized variables.
Frank