[Bug cobol/126540] New: cobol1: error: "VALUE is too long to initialize" should possibly silently ignore insignificant data / only raise a warning

simonsobisch at gnu dot org via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126540

            Bug ID: 126540
           Summary: cobol1: error: "VALUE is too long to initialize"
                    should possibly silently ignore insignificant data /
                    only raise a warning
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: cobol
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simonsobisch at gnu dot org
  Target Milestone: ---

error: VALUE ‘   ’ is too long to initialize ‘VAR’, discarded ‘  ’
  173 |      77  VAR  PIC X(01) VALUE "   ".


that is only seen on GCC, other compilers seem to silently truncate
insignificant data (leading zeroes for numeric, trailing spaces for
alphanumeric and national), which is especially useful if you use constants in
there.

In any case I wonder if that message - when truncating anything significant -
should be downgraded to a warning (which I think is the case for other
compilers).
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.