[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-GnuCOBOL] Redefining a redefinition and misleading error messag

From: Simon Sobisch
Subject: Re: [Bug-GnuCOBOL] Redefining a redefinition and misleading error message
Date: Tue, 3 Jul 2018 22:39:11 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

Hi Martin,

thank you for the sample.
As you already found out cobc -std=mf-trict, -std=ibm-strict and all
"lax" std's allow it (if you want to allow it using the default use
`-findirect-redefines` option). All standard COBOL versions explicit do
not allow it and some compiler dialects follow this rule, therefore the
first message:

> zzz.cbl: 25: error: 'BAR' is not the original definition

is correct.
It seems to be good to tweak the message, just drop a note if you think
you have a nice but not too long message.

The second message is obviously wrong, I guess the definition for
BAR-DEF-1 is internally deleted because of the previous error, leaving
the definition at 1450 vs 725 original bytes.

Should be fixed, thank you for providing the sample.
Patches, welcome, too :-)


Am 02.07.2018 um 19:42 schrieb Martin Ward:
> If I run cobc on the attached COBOL file I get:
> zzz.cbl: 25: error: 'BAR' is not the original definition
> zzz.cbl: 22: error: size of 'BAR' larger than size of 'FOO'
> I don't know if redefining a redefine is allowed in standard COBOL:
> but the second message is definitely incorrect. FOO and BAR
> are both 725 bytes long.
> If I take out the definition of UID1, then the second message
> goes away. UID1 is not part of FOO or BAR.
> cobc -std-mf zzz.cbl
> does not give any errors.
> Output of cobc -V:
> cobc (GnuCOBOL) 2.2.0
> Copyright (C) 2017 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software; see the source for copying conditions.  There is NO
> Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch,
> Edward Hart
> Built     Dec 14 2017 20:42:38
> Packaged  Sep 06 2017 18:48:43 UTC
> C version "4.9.2"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]