[fpc-pascal] SetLength warnings - request

Martok listbox at martoks-place.de
Tue Jan 1 01:55:03 CET 2019


Happy new year, everyone!


Am 31.12.2018 um 10:22 schrieb Michael Van Canneyt:
> Cultural note:
> For native english speakers the above may be somewhat farfetched: But in Dutch
> and French, spelling and grammar are not ruled by custom, but are strictly managed 
> by official language committees...
That is an extremely fitting example!

In my view, modern Pascal is ruled by custom, not by committee. The last time a
committee wrote a Pascal standard, the result was technologically somewhat
obsolete by the time it was published...
But that would be off-topic here.


> I'm curious to see them, because all 'issues' reported here can be perfectly
> repeated (possibly with some modifications) in Delphi. 
> The non-initialization of 'Result' has bitten me more than once in Delphi.
Aye. But it's rather rare in Delphi and very common in FPC, so not everyone
might have encountered it (that's how I'm justifying to myself putting it on the
Portability List instead of starting a Common Mistakes set ;-) ).

> I can't explain things better than Jonas did. I intend to rework his
> arguments and introduce them in the language reference manual.
Feel free to use any of the examples here:
<http://wiki.freepascal.org/User:Martok/Portability_Issues#Managed_Variable_Intialization>

As you said, Delphi makes some of the same mistakes, but at least it doesn't
emit warnings where the code-as-written is interpreted exactly-as-written,
therefore, doing what the programmer told it to do in the first place. The
problem I see is that these bogus warnings drown out the actual programmer
errors signified by the same message.

-- 
Regards,
Martok





More information about the fpc-pascal mailing list