[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-GnuCOBOL] Incorrect parsing of numeric-edited values
From: |
Michael D. Setzer II |
Subject: |
Re: [Bug-GnuCOBOL] Incorrect parsing of numeric-edited values |
Date: |
Sun, 14 May 2017 01:55:36 +1000 |
On an AS/400 it runs, but I had to comment out two lines, and here are the
errors (warnings it showed).
STMT
* 2 MSGID: LBL0047 SEVERITY: 20 SEQNBR: 000200
Message . . . . : Invalid program-name 'TEST-PIC'. Accepted as
'TEST0PIC '.
* 5 MSGID: LBL0240 SEVERITY: 20 SEQNBR: 000600
Message . . . . : Nonnumeric literal expected; numeric literal
'0' found. Literal assumed in quotes.
* 7 MSGID: LBL0014 SEVERITY: 10 SEQNBR: 001100
Message . . . . : Delimiter for literal is not correct.
Literal accepted.
On 13 May 2017 at 7:56, Sergey Kashyrin wrote:
To: Ron Norman <address@hidden>
From: Sergey Kashyrin <address@hidden>
Date sent: Sat, 13 May 2017 07:56:52 -0400
Subject: Re: [Bug-GnuCOBOL] Incorrect parsing of numeric-edited values
Copies to: address@hidden
>
> Hi Ron,
>
> But it is "severe" error on Mainframe :-(
>
>
> On 5/13/17 7:54 AM, Ron Norman wrote:
> I think that test case is perfectly correct and no warning is needed.
> I would expect that ZERO ZEROES ZEROS ZEROE 0 0.000 are all
> meaning a value of 'zero' so
> shouldn't the following all be accepted and mean that the initial value
> of the
> field is zero.
>
> 01 N PIC .999 VALUE 0.
> 01 N PIC .999 VALUE ZERO.
>
> FYI. Micro Focus does not give any warning with this.
> And if it is VALUE ZERO then GnuCOBOL also gives no warning.
>
> I think 0 is the exact same as ZERO.
>
> On Sat, May 13, 2017 at 7:19 AM, Sergey Kashyrin <address@hidden> wrote:
> Hi Edward,
>
> I see GC is accepting the value. Just giving a warning which is
> reasonable.
> Don't think we need to eliminate the warning, which will happen with
> this patch.
> Maybe we need to proceed as with numeric, but to give a warning, at
> least with std=ibm or osvs
>
> SK
>
>
> On 5/13/17 6:55 AM, Edward Hart wrote:
> Hi David,
>
> Thanks for the bug report and patch. This is technically extension,
> but it's a very innocuous one and it's supported by Micro Focus
> (see VALUE Clause, General Rule 1.b). I'll commit this
> immediately.
>
> Edward
>
> On 13 May 2017 at 10:56, David Newall
> <address@hidden> wrote:
> Hi all,
>
> I believe it's bug:
>
> address@hidden cat test-pic.cbl
> IDENTIFICATION DIVISION.
> PROGRAM-ID. TEST-PIC.
>
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 N PIC .999 VALUE 0.
>
> PROCEDURE DIVISION.
> START-PROCEDURE SECTION.
> 000-TOP.
> DISPLAY 'N:', N.
>
> END PROGRAM TEST-PIC.
>
> address@hidden cobc -x test-pic.cbl
> test-pic.cbl: 6: warning: alphanumeric value is expected
>
> If I'm right (about it being a bug), the problem is in typck.c;
> and because of the "TODO" comment, I think it's something
> that slipped through the cracks. I think NUMERIC-EDITED
> could be parsed the same as NUMERIC is.
>
> I'm using r1560. I've attached my suggested patch.
>
> Cheers,
>
> David
>
>
>
>
>
> --
> Cheers
> Ron Norman
>
>
+----------------------------------------------------------+
Michael D. Setzer II - Computer Science Instructor
Guam Community College Computer Center
mailto:address@hidden
mailto:address@hidden
Guam - Where America's Day Begins
G4L Disk Imaging Project maintainer
http://sourceforge.net/projects/g4l/
+----------------------------------------------------------+
http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned: 19,471
Processing time: 32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)
address@hidden CREDITS
ABC 16611686.340441 | EINSTEIN 135271960.288695
ROSETTA 61251302.766601 | SETI 105677196.318525