bug-gnucobol
[Top][All Lists]
Advanced

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

Re: [open-cobol-list] possibly bug: Compare: numeric (USAGE COMP ..


From: Bernard Giroud
Subject: Re: [open-cobol-list] possibly bug: Compare: numeric (USAGE COMP ...) with alphanumeric
Date: Mon May 10 01:37:02 2004

The program does not even compile under OpenVMS
with Compaq COBOL v2.7 :

           IF NUM-FIELD-COMP = X-FIELD
..............^
%COBOL-F-INVRELOP, Incompatible operands in relation condition
at line number 47 in file DISKV2:[bg.gnv]TESTCOMPARE.cob;1
%COBOL-F-ENDNOOBJ, DISKV2:[bg.gnv]TESTCOMPARE.cob;1 completed with 1
diagnostic - object deleted

Bernard Giroud
Credit Lyonnais (Suisse) SA
----- Original Message -----
From: "Thomas Biehler" <address@hidden>
To: <address@hidden>
Cc: "Keisuke Nishida" <address@hidden>
Sent: Friday, May 07, 2004 4:01 PM
Subject: [open-cobol-list] possibly bug: Compare: numeric (USAGE COMP ...)
with alphanumeric


hi all,

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")

There are references to the ANSI 1985 / ISO  2002 standard inside.

None of my compiler give a warning or error at compiling stage!
Instead the runtime behavior is different!  :-(

I have compiled it with Micro Focus Compiler with the following flags:

   cob  -CANS85 -CFLAG=ANS85 -CWARNING=3 TESTCOMPARE.cob

No warnings and no ANSI-FLAGS at all in the compiler-output!
(==> The same behavior with BULL GCOS7 Compiler!)

Runtime-Results:
=====================================================

with Micro-Focus Compiler (= same results with GCOS 7000 Compiler!)
===================================================
#> cobrun TESTCOMPARE.int
COMPARE:  NUM-DISPLAY = X   SUCCESSFULL
COMPARE:  NUM-COMP = X  SUCCESSFULL
COMPARE:  NUM-DISPLAY => NUM-FIELD-X = X  SUCCESSFULL
COMPARE:  NUM-COMP => NUM-FIELD-X = X  SUCCESSFULL


with open-cobol  (cobc -v -Wall  --> no warnings! )
===================================================
#> ./TESTCOMPARE
COMPARE:  NUM-DISPLAY = X   SUCCESSFULL
COMPARE:  NUM-COMP = X  FAILED!
COMPARE:  NUM-DISPLAY => NUM-FIELD-X = X  SUCCESSFULL
COMPARE:  NUM-COMP => NUM-FIELD-X = X  SUCCESSFULL


with tinycobol:  (htcobol -F --> no warnings!)
===================================================
#> ./TESTCOMPARE
COMPARE:  NUM-DISPLAY = X   SUCCESSFULL
COMPARE:  NUM-COMP = X  FAILED!
COMPARE:  NUM-DISPLAY => NUM-FIELD-X = X  SUCCESSFULL
COMPARE:  NUM-COMP => NUM-FIELD-X = X  FAILED!


If you have another compiler  (IBM , Accu-Cobol, Fujitsu ...) ,
could you please compile it (with maximal ANSI-Flagging, "all warnings")
and send the results  (warning, errors , output from running)
to this mailing-list.

Im also very interested in what your meaning is about
the problematic compare.
(Allowed or forbidden from standard ?)

What is the standard conform behavior in ANSI 1985?
(ISO/IEC 2002 is clear !  (= simplified standard text!))

Is this a weakness in the standard ANSI 1985 standard ?
   OR
a BUG in:
      1. open-cobol , tiny-cobol ...
      2. Micro Focus, BULL GCOS7 Compiler ...

My propose for changing open-cobol  is :
(after evaluate your results / meanings !)
-  give out a warning/error in ANSI 1985 mode
   (at least a warning if it ANSI-conform, error if not ANSI-conform!)
-  give out a sytnax error in ISO 2002 mode

Thanks and bye!

Thomas



********************************************************************************
This e-mail contains confidential information or information belonging 
to the Credit Lyonnais Group entity sending it and is intended solely 
for the addressees. Any views expressed in this message are those of 
the individual sender and its contents do not constitute a commitment 
by Credit Lyonnais unless confirmed by letter or fax. The unauthorised 
disclosure, use, dissemination or copying (either whole or partial) of 
this e-mail, or any information it contains, is prohibited. E-mails are 
susceptible to alteration and their integrity cannot be guaranteed.
Internet communications are not secured and therefore Credit Lyonnais 
shall not be liable for this e-mail if modified or falsified. If you 
are not the intended recipient of this e-mail, please delete it 
immediately from your system and notify the sender of the wrong 
delivery and the mail deletion.
********************************************************************************



reply via email to

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