[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] Re: possibly bug: Compare: numeric (USAGE COMP .
From: |
Thomas Biehler |
Subject: |
Re: [open-cobol-list] Re: possibly bug: Compare: numeric (USAGE COMP ...) with alphanumeric |
Date: |
Mon May 17 07:38:02 2004 |
User-agent: |
KMail/1.4.3 |
On Sunday 16 May 2004 16:36, Keisuke Nishida wrote:
> At Fri, 7 May 2004 16:01:14 +0200,
>
> Thomas Biehler wrote:
> > i have attached a testprogram "TESTCOMPARE.cob" (ANSI 1985!)
> > which shows the problematic case of comparison:
> > PIC S9(4) COMP = PIC X(4)
> > (numeric field with a small value => 1 = "0001")
>
> This is a bug. I have fixed it in CVS.
>
> Note that I haven't implemented binary truncation correctly yet,
> and the current implementation might not work as you expect.
>
> Keisuke
>
Hi Keisuke,
I can live with this "bug-fix" and the new behavior of open-cobol.
(=> convert ("move") the comp-field to a USAGE DISPLAY temporary-field
before the alphanumeric compare is "reasonable" behavior)
But i believe that allowing the "critical compare":
"NON - USAGE DISPLAY" numeric and alphanumeric
is NOT ANSI 1985 or ISO 2002 conform!
(--> I agree with the Compaq COBOL v2.7 compiler from OpenVMS)
To be strictly standard conform a error message instead should be implemented.
(If open-cobol allow it as now, (IMO a "extension") then a warning
would be very helpfull to find the "critical compares" in large
cobol-sources)
So far i unterstand the compiler-source, the error reporting here is not
trivial to implement.
Therefore it should be only a TODO-topic with low / middle priority.
(I know, better error reporting is already TODO,
--> so this requirement is only one additional subpoint for the list!)
bye and thanks.
Thomas
P.S. And also THANKS to all discussion members
for your contributions!