diff --git a/gcc/cobol/ChangeLog b/gcc/cobol/ChangeLog index 1089b915af7c306985d5c64a0e95354c11158382..38b3ad14f25a672422b67b0d390a36125ceb4a04 100644 --- a/gcc/cobol/ChangeLog +++ b/gcc/cobol/ChangeLog @@ -50,3 +50,7 @@ gcc/cobol has no calls to warnx gcc/cobol has no need for "err.h", and all calls have been converted to cbl_warn, cbl_warnx, cbl_err, cbl_errx + +2024-12-25 Robert Dubner <rdubner@symas.com> + * Normalize #includes in util.cc + diff --git a/gcc/cobol/cobol-system.h b/gcc/cobol/cobol-system.h index 86d4faea2e2130e67d4fc680a9dab2e08a5d48cc..b9fda8528bce67985c2a9261804b2c21ea45399b 100644 --- a/gcc/cobol/cobol-system.h +++ b/gcc/cobol/cobol-system.h @@ -40,14 +40,16 @@ // These must be included before the #poison declarations in system.h. -#include <string> -#include <vector> +#define INCLUDE_STRING +#define INCLUDE_VECTOR +#define INCLUDE_MAP +#include <cctype> +#include <stack> #include <unordered_map> #include <unordered_set> - #include "system.h" #endif diff --git a/gcc/cobol/genapi.h b/gcc/cobol/genapi.h index f91b890ddf144a975b85a77503862cdcf087af1d..39144cb6651d4057cc2b2532050d231b75c460d3 100644 --- a/gcc/cobol/genapi.h +++ b/gcc/cobol/genapi.h @@ -30,7 +30,6 @@ #ifndef _GENAPI_H_ #define _GENAPI_H_ -#include "ec.h" #include "symbols.h" #define DISPLAY_ADVANCE true diff --git a/gcc/cobol/gengen.cc b/gcc/cobol/gengen.cc index 7c7892e6705ca86cb34ef97e5eb0e32f5bc1666f..a50dd9a8b4b4e0c27d6ef08d82f2a5ebe3f8ed0d 100644 --- a/gcc/cobol/gengen.cc +++ b/gcc/cobol/gengen.cc @@ -95,6 +95,7 @@ #include "toplev.h" #include "function.h" #define HOWEVER_GCC_DEFINES_TREE 1 +#include "symbols.h" #include "gengen.h" #include "util.h" diff --git a/gcc/cobol/gengen.h b/gcc/cobol/gengen.h index a03f46576852b2fb4bb862d7185271bf2ebd1bc5..d5f1a727360b23ed3e4456a0bd008db42aa8a80a 100644 --- a/gcc/cobol/gengen.h +++ b/gcc/cobol/gengen.h @@ -75,10 +75,6 @@ #define WCHAR_P wchar_ptr_type_node #define FILE_P fileptr_type_node -#include <vector> -#include <unordered_map> -#include "symbols.h" - #define SIZE128 (16) // In bytes /* Explanatory note for vs_file_static variables diff --git a/gcc/cobol/genutil.cc b/gcc/cobol/genutil.cc index 49e95910750e1c6e1c9367121f009d80750d6eb4..e3fe14e66feb5ac2567beb4ba5293530a71b973d 100644 --- a/gcc/cobol/genutil.cc +++ b/gcc/cobol/genutil.cc @@ -31,6 +31,7 @@ #include "coretypes.h" #include "tree.h" #define HOWEVER_GCC_DEFINES_TREE 1 +#include "symbols.h" #include "gengen.h" #include "genutil.h" #include "structs.h" diff --git a/gcc/cobol/structs.cc b/gcc/cobol/structs.cc index b90a2f9f1098d31c3378534caa03d6f8370acf06..d04d8d0c5fd9b05582e2c449fe6848010df4ec39 100644 --- a/gcc/cobol/structs.cc +++ b/gcc/cobol/structs.cc @@ -56,6 +56,7 @@ #include "coretypes.h" #include "tree.h" #define HOWEVER_GCC_DEFINES_TREE 1 +#include "symbols.h" #include "gengen.h" tree diff --git a/gcc/cobol/util.cc b/gcc/cobol/util.cc index 4da1a708e3429bce3969d95c090e30d07c1e6d90..01f47d81c44d7e809f1a0cdf4e1499b3882f91b8 100644 --- a/gcc/cobol/util.cc +++ b/gcc/cobol/util.cc @@ -39,11 +39,12 @@ * that it can use the standard functions. The rest of util.cc uses * the libiberty uppercase replacements. */ - #include "lexio.h" #include "cobol-system.h" +#include <langinfo.h> + #include "coretypes.h" #include "version.h" #include "demangle.h" @@ -60,8 +61,6 @@ #include "opts.h" #define HOWEVER_GCC_DEFINES_TREE - -#include "symbols.h" #include "genapi.h" #pragma GCC diagnostic ignored "-Wunused-result" @@ -221,7 +220,6 @@ repeat_count( const char picture[] ) const char *numed_message; -#include <cctype> extern int yydebug; bool @@ -932,10 +930,6 @@ cbl_field_t::report_invalid_initial_value() const { return; } - -#include <map> -#include <string> - // Return the field representing the subscript whose literal value // exceeds the OCCURS clause for that dimension, else NULL if all // literals are in bounds. @@ -1749,12 +1743,6 @@ corresponding_arith_fields( cbl_field_t *lhs, cbl_field_t *rhs ) { return corresponding_fields( lhs, rhs, find_corresponding::arith_op ); } -#include <stdlib.h> -#include <unistd.h> - -#include <sys/mman.h> -#include <sys/stat.h> -#include <sys/types.h> static int file_of( cbl_file_t *file ) { // return fileno from var_decl_node @@ -1851,7 +1839,6 @@ cbl_file_union( int tgt, int src ) { */ int keyword_of( const char name[] ); -#include <regex.h> int name_space_kw( const char input[], int *token ) { regex_t reg; @@ -1954,7 +1941,6 @@ date_time_fmt( const char input[] ) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-variable" -#include <stack> struct input_file_t { ino_t inode; int lineno; const char *name; @@ -2183,7 +2169,6 @@ cobol_set_debugging( bool flex, bool yacc, bool parser ) os_locale_t os_locale = { "UTF-8", xstrdup("C.UTF-8") }; -#include <langinfo.h> void cobol_parse_files (int nfile, const char **files)