[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Display of VAR1 PICTURE 9P includes an 0x00 NULL character
From: |
Robert Dubner |
Subject: |
Display of VAR1 PICTURE 9P includes an 0x00 NULL character |
Date: |
Thu, 28 Nov 2019 15:54:19 -0600 (CST) |
Hello, folks. My name is Bob Dubner, I work at the Symas Corporation.
I'm new to open software development, but I'm certainly not new to
debugging. So, I am supplying the information that I figured would be
helpful.
I have not made an effort to find where in the cobc code the error might
be found.
If there is a preferred way of reporting problems, please let me know.
Bob Dubner
========
Statement of problem:
DISPLAY of a variable with a greater than 1.00 P-scaled PICTURE string
generates
a string that ends with a 0x00 NULL before the newline.
Demonstration session:
bob@doobie:~/projects/cobol/bug$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
bob@doobie:~/projects/cobol/bug$ uname -a
Linux doobie 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019
x86_64 x86_64 x86_64 GNU/Linux
bob@doobie:~/projects/cobol/bug$ cobc --version
cobc (GnuCOBOL) 3.1-dev.0
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward
Hart
Built Nov 28 2019 16:36:43
Packaged Nov 27 2019 22:35:50 UTC
C version "7.4.0"
bob@doobie:~/projects/cobol/bug$ cat bug.cbl
IDENTIFICATION DIVISION.
PROGRAM-ID. QWIK-CHECK.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 VAR1 PICTURE 9P VALUE 50 .
01 VAR2 PICTURE 9 VALUE 5 .
01 VAR3 PICTURE P9 VALUE 0.05 .
PROCEDURE DIVISION.
DISPLAY VAR1
DISPLAY VAR2
DISPLAY VAR3
STOP RUN.
bob@doobie:~/projects/cobol/bug$ cobc -x bug.cbl
bob@doobie:~/projects/cobol/bug$ ./bug >bug.txt
bob@doobie:~/projects/cobol/bug$ hexdump -C bug.txt
00000000 35 30 00 0a 35 0a 2e 30 35 0a |50..5..05.|
0000000a
Note that the third character in bug.txt is an 0x00 NULL.
- Display of VAR1 PICTURE 9P includes an 0x00 NULL character,
Robert Dubner <=