[Bug cobol/119332] cobol frontend does not support version dump options specified in --help

2026-02-06 Thread rdubner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119332

Robert Dubner  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #5 from Robert Dubner  ---
(In reply to Richard Biener from comment #1)
> Confirmed.  There were similar issues with -print options which I fixed in
> r15-7952-gc20e24f8e7318b
> 
> There's something odd with how the driver works, other frontends do not have
> to special-case this.

Yes.  The odd thing is because of, well, COBOL.

Fifty-plus years ago, the creators of C decided to solve the problem of "Where
shall execution start" by using the "int main(...)" function.

COBOL has no such convention.

To make it possible for somebody to just "gcobol foo.cbl" to create an a.out
executable that will just run, by default I look for the first PROGRAM-ID in
foo.cbl and I inject a main() entry point that calls that first PROGRAM-ID.

A developer has full control over whether main() function is injected, where it
is injected, and which PROGRAM-ID it uses as the initial execution point by
using the -main and -nomain switches.

Implementing the default case, and the processing of -main and -nomain led to
the need to keep track of whether there are input files during
lang_specific_driver.

[Bug cobol/119332] cobol frontend does not support version dump options specified in --help

2026-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119332

--- Comment #4 from GCC Commits  ---
The master branch has been updated by Robert Dubner :

https://gcc.gnu.org/g:bf34364e50c62df1458481539a885036c9a6cc0a

commit r16-7368-gbf34364e50c62df1458481539a885036c9a6cc0a
Author: Robert Dubner 
Date:   Fri Feb 6 13:55:39 2026 -0500

cobol: Process -dumpspecs, -dumpversion, -dumpmachine. [PR119332]

Process the -dumpspecs, -dumpversion, and -dumpmachine options without
complaining about a lack of input files.

gcc/cobol/ChangeLog:

PR cobol/119332
* gcobolspec.cc (lang_specific_driver): Add -dumpspecs,
-dumpversion, -dumpmachine to the no_files_error=false cases.

[Bug cobol/119332] cobol frontend does not support version dump options specified in --help

2025-05-22 Thread simonsobisch at gnu dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119332

--- Comment #3 from Simon Sobisch  ---
Instead of "/dev/null" you can also write "banana", it doesn't matter. Seems
like the option parsing is broken "somewhere".

[Bug cobol/119332] cobol frontend does not support version dump options specified in --help

2025-05-21 Thread jklowden at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119332

James K. Lowden  changed:

   What|Removed |Added

 CC||jklowden at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |rdubner at gcc dot 
gnu.org

--- Comment #2 from James K. Lowden  ---
$ gcobol -dumpmachine /dev/null
aarch64-unknown-linux-gnu
$ gcobol -dumpmachine 
gcobol: fatal error: no input files

Not sure this is right, either: 

gcobol -dumpversion /dev/null
16.0.0

[Bug cobol/119332] cobol frontend does not support version dump options specified in --help

2025-03-18 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119332

Richard Biener  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2025-03-18
 Status|UNCONFIRMED |NEW

--- Comment #1 from Richard Biener  ---
Confirmed.  There were similar issues with -print options which I fixed in
r15-7952-gc20e24f8e7318b

There's something odd with how the driver works, other frontends do not have to
special-case this.