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

commit r17-4718-gd840f9764d21cad47175aac4565d14963952d80d
Author: Xavier Del Campo Romero <[email protected]>
Date:   Thu Sep 24 14:45:59 2026 +0200

    cobol: Fix various options in gcobc
    
    Original patch by Simon Sobisch.
    
    gcc/cobol/ChangeLog:
    
            * gcobc: Fix --various command-line options.

Diff:
---
 gcc/cobol/gcobc | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/gcc/cobol/gcobc b/gcc/cobol/gcobc
index 46287f02efd4..43b5a0ea2a71 100755
--- a/gcc/cobol/gcobc
+++ b/gcc/cobol/gcobc
@@ -232,6 +232,8 @@ do
         -echo) echo="echo"
                ;;
 
+        # note: if warnings on not implemented GC exceptions should be 
suppressed,
+        # then use -Wno-ec-unknown
         -fec=* | -fno-ec=*)
             opt="$(echo "$opt" | sed -E 
's/-f(no-)?ec=/-f\1cobol-exceptions=EC-/g')"
              opts="$opts $opt"
@@ -438,12 +440,16 @@ do
                ;;
         -i | --info) warn "$opt"
                      ;;
-        -include )
-            pending_arg=$opt
+
+        # include a COBOL copybook --> gcobol's -include
+        --copy)
+            pending_arg="-include "  # space-separation needed
             ;;
-        # no-space version: just concatenate
-        -include* )
-            opts="$opts $opt"
+        #
+
+        # include a C header --> no real option in gcobol
+        --include)
+            error "$opt $incomparable"
             ;;
         #
         # Options that may have a space  before the argument, or not
@@ -525,7 +531,8 @@ do
              # opts="$opts --version"
             ;;
         # pass through, -Wall support pending gcc to set for all front ends
-        # cobc does not support all gcc -Wl options
+        # note: while cobc does not support gcc's -Wl options, they
+        # might be passed anyway for different reasons e.g.: -Wl,rpath.
         -w | -W | -Wextra | -Wno-* | -Wl,*) opts="$opts $opt"
              ;;

Reply via email to