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
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to