[gcc r17-2630] cobol: Enable suppression of unimplemented exception conditions.

"James K. Lowden via Gcc-cvs" <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:7ec7871b363162d154266d2b052a3690ee4c6aa8

commit r17-2630-g7ec7871b363162d154266d2b052a3690ee4c6aa8
Author: James K. Lowden <[email protected]>
Date:   Wed Jul 22 16:19:14 2026 -0400

    cobol: Enable suppression of unimplemented exception conditions.
    
    For each warning, provide both Wx and Wno-x in the specs string, so
    that the driver passes both forms to the driver.  This enables, in
    addition to being able to defeat a default, to override the warning
    status implied by a dialect.
    
    gcc/cobol/ChangeLog:
    
            * cobol1.cc (enable_exceptions): Remove redundant message.
            * lang-specs.h: Provide both forms of every warning.
            * parse.y: Remove deleterious comment.

Diff:
---
 gcc/cobol/cobol1.cc    |   4 --
 gcc/cobol/lang-specs.h | 104 ++++++++++++++++++++++++-------------------------
 gcc/cobol/parse.y      |   4 +-
 3 files changed, 55 insertions(+), 57 deletions(-)

diff --git a/gcc/cobol/cobol1.cc b/gcc/cobol/cobol1.cc
index d6ffac128b7b..fd226b520f63 100644
--- a/gcc/cobol/cobol1.cc
+++ b/gcc/cobol/cobol1.cc
@@ -361,10 +361,6 @@ enable_exceptions( bool enable ) {
       cbl_message(EcUnknownW, "unrecognized exception '%s'", name);
       continue;
     }
-    ec_disposition_t disposition = ec_type_disposition(type);
-    if( disposition != ec_implemented(disposition) ) {
-      cbl_unimplemented("exception '%s'", name);
-    }
     add_cobol_exception(type, enable );
   }
 }
diff --git a/gcc/cobol/lang-specs.h b/gcc/cobol/lang-specs.h
index 5b839a49a149..d64353523e04 100644
--- a/gcc/cobol/lang-specs.h
+++ b/gcc/cobol/lang-specs.h
@@ -47,58 +47,58 @@
         "%{preprocess} "
         "%{dialect} "
         "%{include} "
-	"%{Wno-apply-commit} "
-	"%{Wno-any-length} "
-	"%{Wno-file-code-set} "
-	"%{Wno-high-order-bit} "
-	"%{Wno-bad-line-directive} "
-	"%{Wno-bad-numeric} "
-	"%{Wassign-external} "
-	"%{Wassign-file} "
-	"%{Wno-binary-long-long} "
-	"%{Wno-call-fd} "
-	"%{Wno-call-giving} "
-	"%{Wno-call-literal} "
-	"%{Wno-cdf-dollar} "
-	"%{Wno-cdf-invalid-parameter} "
-	"%{Wno-cdf-name-not-found} "
-	"%{Wno-cobol-eject} "
-	"%{Wno-cobol-resume} "
-	"%{Wno-cobol-volatile} "
-	"%{Wno-comp-6} "
-	"%{Wno-comp-x} "
-	"%{Wno-copybook-found} "
-	"%{Wno-ec-unknown} "
-	"%{Wno-entry-convention} "
-	"%{Wno-ibm-cdf} "
-	"%{Wno-iconv-error} "
-	"%{Wno-include-file-found} "
-	"%{Wno-include-file-not-found} "
-	"%{Wno-inspect-trailing} "
-	"%{Wno-length-of} "
-	"%{Wno-level-1-occurs} "
-	"%{Wno-level-78} "
-	"%{Wno-level-78-defined} "
-	"%{Wno-literal-concat} "
-	"%{Wno-locale-error} "
-	"%{Wno-move-corresponding} "
-	"%{Wno-move-index} "
-	"%{Wno-move-pointer} "
-	"%{Wno-nllanginfo-error} "
-	"%{Wno-operator-space} "
-	"%{Wno-preprocessor-error} "
-	"%{Wno-procedure-not-found} "
-	"%{Wno-procedure-pointer} "
-	"%{Wno-replace-error} "
-	"%{Wno-returning-number} "
-	"%{Wno-segment-error} "
-	"%{Wno-segment-negative} "
-	"%{Wno-stop-number} "
-	"%{Wno-stray-indicator} "
-	"%{Wno-usage-typename} "
-	"%{Wno-recording-mode} "
-	"%{Wno-set-locale-to} "
-	"%{Wno-set-to-locale} "
+	"%{Wapply-commit} %{Wno-apply-commit} "
+	"%{Wany-length} %{Wno-any-length} "
+	"%{Wfile-code-set} %{Wno-file-code-set} "
+	"%{Whigh-order-bit} %{Wno-high-order-bit} "
+	"%{Wbad-line-directive} %{Wno-bad-line-directive} "
+	"%{Wbad-numeric} %{Wno-bad-numeric} "
+	"%{Wassign-external} %{Wno-assign-external} "
+	"%{Wassign-file} %{Wno-assign-file} "
+	"%{Wbinary-long-long} %{Wno-binary-long-long} "
+	"%{Wcall-fd} %{Wno-call-fd} "
+	"%{Wcall-giving} %{Wno-call-giving} "
+	"%{Wcall-literal} %{Wno-call-literal} "
+	"%{Wcdf-dollar} %{Wno-cdf-dollar} "
+	"%{Wcdf-invalid-parameter} %{Wno-cdf-invalid-parameter} "
+	"%{Wcdf-name-not-found} %{Wno-cdf-name-not-found} "
+	"%{Wcobol-eject} %{Wno-cobol-eject} "
+	"%{Wcobol-resume} %{Wno-cobol-resume} "
+	"%{Wcobol-volatile} %{Wno-cobol-volatile} "
+	"%{Wcomp-6} %{Wno-comp-6} "
+	"%{Wcomp-x} %{Wno-comp-x} "
+	"%{Wcopybook-found} %{Wno-copybook-found} "
+	"%{Wec-unknown} %{Wno-ec-unknown} "
+	"%{Wentry-convention} %{Wno-entry-convention} "
+	"%{Wibm-cdf} %{Wno-ibm-cdf} "
+	"%{Wiconv-error} %{Wno-iconv-error} "
+	"%{Winclude-file-found} %{Wno-include-file-found} "
+	"%{Winclude-file-not-found} %{Wno-include-file-not-found} "
+	"%{Winspect-trailing} %{Wno-inspect-trailing} "
+	"%{Wlength-of} %{Wno-length-of} "
+	"%{Wlevel-1-occurs} %{Wno-level-1-occurs} "
+	"%{Wlevel-78} %{Wno-level-78} "
+	"%{Wlevel-78-defined} %{Wno-level-78-defined} "
+	"%{Wliteral-concat} %{Wno-literal-concat} "
+	"%{Wlocale-error} %{Wno-locale-error} "
+	"%{Wmove-corresponding} %{Wno-move-corresponding} "
+	"%{Wmove-index} %{Wno-move-index} "
+	"%{Wmove-pointer} %{Wno-move-pointer} "
+	"%{Wnllanginfo-error} %{Wno-nllanginfo-error} "
+	"%{Woperator-space} %{Wno-operator-space} "
+	"%{Wpreprocessor-error} %{Wno-preprocessor-error} "
+	"%{Wprocedure-not-found} %{Wno-procedure-not-found} "
+	"%{Wprocedure-pointer} %{Wno-procedure-pointer} "
+	"%{Wreplace-error} %{Wno-replace-error} "
+	"%{Wreturning-number} %{Wno-returning-number} "
+	"%{Wsegment-error} %{Wno-segment-error} "
+	"%{Wsegment-negative} %{Wno-segment-negative} "
+	"%{Wstop-number} %{Wno-stop-number} "
+	"%{Wstray-indicator} %{Wno-stray-indicator} "
+	"%{Wusage-typename} %{Wno-usage-typename} "
+	"%{Wrecording-mode} %{Wno-recording-mode} "
+	"%{Wset-locale-to} %{Wno-set-locale-to} "
+	"%{Wset-to-locale} %{Wno-set-to-locale} "
         "%{nomain} "
         "%{!fsyntax-only:%(invoke_as)} "
         , 0, 0, 0},
diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y
index 5f7e4ea7a228..06a3cfb5fd58 100644
--- a/gcc/cobol/parse.y
+++ b/gcc/cobol/parse.y
@@ -2391,10 +2391,12 @@ unique_key:     %empty          { $$ = true; }
                  * If the argument to ASSIGN to is a literal, that exact name
                  * will be opened.  ASSIGN to literal cannot be used with USING.
                  */
+
 assign_clause:  ASSIGN to selected_name[selected]  {
                   $$.clause = assign_clause_e;
                   $$.file = new cbl_file_t(protofile);
-                  $$.file->filename = field_index($selected);  // of the FldLiteralA
+                  $$.file->filename = field_index($selected);
+
                   if( ! is_quoted($selected) ) {
                     dialect_ok(@selected, IsoAssignFile, $selected->name);
                   }
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.