[fpc-pascal] Result: string

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Mar 6 10:40:48 CET 2013


On 05 Mar 2013, at 12:34, José Mejuto wrote:

> El 05/03/2013 11:23, Howard Page-Clark escribió:
>>
>>> The code that makes me wonder something is wrong is this one:
>>>
> [...]
>>
>> For me (win32, FPC 2.6.2) the output is identical (= "A") whether  
>> or not
>> Result in TheA() is initialised manually or not. Perhaps 2.7.1 has a
>> regression here if it differs for you?
>>
>
> The problem is not the different behavior as it is or will be noted  
> in documentation, the problem is the lack of warning of using a not  
> initialized variable,

FPC 2.6.2 does give a warning (code is from http://bugs.freepascal.org/view.php?id=20907#c55064 
  ):

$ fpc -vw tt7.pp
Free Pascal Compiler version 2.6.2 [2013/02/03] for powerpc
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Darwin for PowerPC
Compiling tt7.pp
tt7.pp(8,13) Warning: Function result variable does not seem to  
initialized
Assembling (pipe) tt7.s
Linking tt7
26 lines compiled, 2.6 sec
1 warning(s) issued

> so it is hard to fix code that works fine in 2.6.x and that could  
> fail with Trunk.

It could also fail in 2.6.x, just less often.


Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130306/e1381653/attachment.html>


More information about the fpc-pascal mailing list