Adam Naumowicz wrote:
On Thu, 18 Apr 2002, Ernst-Ludwig Bohnen wrote:
On Wed, 17 Apr 2002, Carel Fellinger wrote:
after porting a few thousand lines I think I spotted the next bug.
take this simple program:
program err; type pword = ^word; word = boolean;
word is predeclared as unsigned 32 bit integer. Should gpc complain already here or warn and accept the redefinition and do the job?
As far as I got the ISO standard correct, the 'pword' definition should only be considered a foreward declaration of 'word' when 'word' is undefined and has a definition later in the same block. So the current behaviour of GPC seems rather consequent to me and I don't understand why all Barland's compilers and FPC process it the other way ;-(
If you don't delay the definition you have a situation where the outer block can invalidate a perfectly correct inner block. In particular, word is not predefined or reserved in ISO7185, and I find no reference to it in ISO10206. Converting a valid program to invalid has to be anathema. So I think that, in this case, Borland and FPC have it right.