Tested on x86_64, aarch64 Linux/Darwin, powerpc64le Linux,
OK for trunk?
thanks
Iain

--- 8< ---

Instead of "sorry-ing" on an ignored SECTION this prints out
what failed and continues (we also quote the failed name to help
identify cases where it is empty).

        PR cobol/119632

gcc/cobol/ChangeLog:

        * parse.y: Do not sorry on a failed SECTION, print a
        message and continue.

Signed-off-by: Iain Sandoe <i...@sandoe.co.uk>
---
 gcc/cobol/parse.y | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y
index 3f282013a4a..7addccdc750 100644
--- a/gcc/cobol/parse.y
+++ b/gcc/cobol/parse.y
@@ -6971,9 +6971,9 @@ section_kw:     SECTION
                 {
                   if( $1 ) {
                    if( *$1 == '-' ) {
-                     error_msg(@1, "SECTION segment %s is negative", $1);
+                     error_msg(@1, "SECTION segment %<%s%> is negative", $1);
                     } else {
-                      cbl_unimplementedw("SECTION segment %s was ignored", $1);
+                      error_msg(@1, "SECTION segment %<%s%> was ignored", $1);
                     }
                  }
                 }
-- 
2.39.2 (Apple Git-143)

Reply via email to