]> git.ipfire.org Git - thirdparty/gcc.git/commit
cobol: Diagnostic messages, Flex build, and some cppcheck reports. [PR120328, PR119695]
authorRobert Dubner <rdubner@symas.com>
Fri, 6 Jun 2025 20:32:22 +0000 (16:32 -0400)
committerRobert Dubner <rdubner@symas.com>
Tue, 29 Jul 2025 16:06:39 +0000 (12:06 -0400)
commitcd1fd184020d319d117768f2de1500569b3b1e67
tree97dcec1970d450b30838337fcb3a8862f58c7b18
parent6c214d4e458afd628c6e511df8a6cc1e5f4ab776
cobol: Diagnostic messages, Flex build, and some cppcheck reports. [PR120328, PR119695]

Remove %0x and similar from diagnostic framework messages.  Remove %zu
from printf messages because it is not supported on some
platforms. Corrections in response to cppcheck.  Sundry small fixes.

gcc/cobol/ChangeLog:

PR cobol/120328
* Make-lang.in: Success with non-English locale.
PR cobol/119695
* cbldiag.h (cbl_unimplemented_at): Comment:
* cdf-copy.cc (copybook_elem_t::open_file): Indentation.
* cdf.y: YYABORT on certain errors.
* cdfval.h (cdf_value): Const parameter.
* copybook.h (class copybook_elem_t): Initialization.
(class uppername_t): Explicit constructor.
* except.cc (ec_type_descr): Remove %04s.
(cbl_enabled_exceptions_t::dump): Remove %zu.
* exceptg.h (class exception_turn_t): Explicit constructor.
* genapi.cc (parser_perform_conditional): Remove %zu.
(set_exception_environment): Formatting.
(parser_statement_begin): Exception overhead.
(parser_perform_conditional): Formatting:
(parser_perform_conditional_end): Eliminate size_t.
(parser_check_fatal_exception): Exception overhead.
(parser_perform_conditional_end): Remove %zu.
* inspect.h (struct cbx_inspect_match_t): Const reference.
(struct cbx_inspect_t): Const parameter.
* lexio.cc (cdftext::process_file): Remove %zu.
* lexio.h (struct YYLTYPE): Remove unneeded struct.
(YYLTYPE_IS_DECLARED): Likewise.
(YYLTYPE_IS_TRIVIAL): Likewise.
* parse.y: Comment; change DOT.
* scan.l: Scan function names without swallowing whitespace.
* scan_ante.h (scanner_parsing): Remove %zu.
(scanner_parsing_pop): Remove %zu.
(binary_integer_usage): Remove %zu.
* scan_post.h (prelex): Correct post-CDF resumption.
(yylex): Clearer message.
* symbols.cc (symbol_table_extend): Explicit constructor.
(elementize): Const parameter.
(is_variable_length): Correct always-false.
(symbols_update): Remove unnecessary shadow variable.
(struct symbol_elem_t): Const parameter.
(symbol_alphabet_add): Const parameter.
(new_literal_add): Initialization.
* symbols.h (class cbl_domain_elem_t): Correct assignment.
(struct cbl_span_t): Improve constructor.
(struct cbl_refer_t): Initialization.
(struct cbl_alphabet_t): Rename shadow variable.
(struct cbl_file_key_t): Remove unused constructor.
(struct symbol_elem_t): Initialization.
(struct cbl_until_addresses_t): Use unsigned int, for messages.
(struct cbl_prog_hier_t): Initialization.
(struct cbl_perform_tgt_t): Repair constructor.
(struct cbl_label_t): Const parameter.
(symbol_typedef_add): Const parameter.
(symbol_field_add): Explicit constructor.
(symbol_label_add): Explicit constructor.
(symbol_program_add): Remove C-style "struct" use.
(symbol_special_add): Remove C-style "struct" use.
(symbol_alphabet_add): Const parameter.
(symbol_file_add): Remove C-style "struct" use.
(symbol_section_add): Remove C-style "struct" use.
* symfind.cc: Const parameter.
* util.cc (gb4): New function.
* util.h (gb4): New function.
* TODO: New file.

libgcobol/ChangeLog:

* common-defs.h (enum cbl_file_mode_t): Whitespace.
(enum file_stmt_t): Likewise.
(ec_cmp): Likewise.
(struct cbl_declarative_t): Add "explicit" keyword.
(class cbl_enabled_exceptions_t): Whitespace.
* gfileio.cc: Remove cppcheck comment.
* libgcobol.cc (class ec_status_t): Add "explicit" keyword.
(match_declarative): Remove %zu.
(default_exception_handler): Likwise.
(__gg__check_fatal_exception): Exception overhead.
(__gg__exception_push): Remove %zu.
(__gg__exception_pop): Likewise.
(cbl_enabled_exception_t::dump): Likewise.
(__gg__match_exception): Exception overhead; remove %zu.
(cbl_enabled_exceptions_t::dump): Remove %zu.
(__gg__set_exception_environment): Likewise.

Co-authored-by: James K. Lowden <jklowden@cobolworx.com>
Co-authored-by: Robert Dubner <rdubner@symas.com>
(cherry picked from commit 37f5fdd008399c239e0689f2e864519505c78c7e)
25 files changed:
gcc/cobol/Make-lang.in
gcc/cobol/TODO [new file with mode: 0644]
gcc/cobol/cbldiag.h
gcc/cobol/cdf-copy.cc
gcc/cobol/cdf.y
gcc/cobol/cdfval.h
gcc/cobol/copybook.h
gcc/cobol/except.cc
gcc/cobol/exceptg.h
gcc/cobol/genapi.cc
gcc/cobol/inspect.h
gcc/cobol/lexio.cc
gcc/cobol/lexio.h
gcc/cobol/parse.y
gcc/cobol/scan.l
gcc/cobol/scan_ante.h
gcc/cobol/scan_post.h
gcc/cobol/symbols.cc
gcc/cobol/symbols.h
gcc/cobol/symfind.cc
gcc/cobol/util.cc
gcc/cobol/util.h
libgcobol/common-defs.h
libgcobol/gfileio.cc
libgcobol/libgcobol.cc