[Bug cobol/126854] New: CALL ... USING "literal" should be passed by CONTENT -> is this implied with -Wno-call-literal?

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=126854

            Bug ID: 126854
           Summary: CALL ... USING "literal" should be passed by CONTENT
                    -> is this implied with -Wno-call-literal?
           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: ---

That's very likely an extension, just not supported by gcobol (also not with
dialect gnu - while GnuCOBOL supports that)


           call "SYSTEM" using "ls * > ls.out"

GCC15 had a parsing error, GCC16 changed that to 

<source>:11:32: error: cannot pass 'ls * > ls.out' BY REFERENCE
[-Wcall-literal]
   11 |            call "SYSTEM" using "ls * > ls.out"
      |                                ^~~~~~~~~~~~~~~ 

and compiles with -Wno-call-literal (which may should be "included" in -dialect
gnu).

But ... is the literal actually copied to a local variable of that size and
then this data-copy passed BY REFERENCE under the hood (which is what BY
CONTENT does)?
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.