https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125987

            Bug ID: 125987
           Summary: gcobol --help for -no_main doesn't agree with
                    implementation (which provides -nomain)
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: cobol
          Assignee: unassigned at gcc dot gnu.org
          Reporter: peeterjoot at protonmail dot com
  Target Milestone: ---

Running gcobol version:

```bash
# /opt/gcc-trunk-20260606/bin/gcobol --version
gcobol (GCC) 17.0.0 20260604 (experimental)
Copyright (C) 2026 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

The --help output shows:

```bash
# /opt/gcc-trunk-20260606/bin/gcobol --help 2>&1 | grep -A5 -e -main
  -main   option uses the first PROGRAM of filename as the entry point for
          the main() procedure.  
  -no_main    
          means that there is no -main, and the main() entry point is
          provided by some other compilation or .o file
```

but that doesn't match the implementation:

```bash
# cat FOO.cob
       IDENTIFICATION DIVISION.
       PROGRAM-ID.    FOO.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       LINKAGE SECTION.
       PROCEDURE DIVISION.
           GOBACK
           .
#  /opt/gcc-trunk-20260606/bin/gcobol -c -no_main FOO.cob 
gcobol: error: unrecognized command-line option ‘-no_main’; did you mean
‘-nomain’?

#  /opt/gcc-trunk-20260606/bin/gcobol -c -nomain FOO.cob 
#  # okay.
```

Reply via email to