diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2025-04-06 14:56:20 +0100 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2025-04-07 15:28:17 +0100 |
commit | 6f6c2694dc7c07bca5086c77ef29f3793e0c61c2 (patch) | |
tree | 4f952ab7f1ef2df0313289378186e91409b256d7 | |
parent | 059b5509c14904b55c37f659170240ae0d2c1c8e (diff) | |
download | gcc-6f6c2694dc7c07bca5086c77ef29f3793e0c61c2.zip gcc-6f6c2694dc7c07bca5086c77ef29f3793e0c61c2.tar.gz gcc-6f6c2694dc7c07bca5086c77ef29f3793e0c61c2.tar.bz2 |
cobol: Address some iconv issues.
Darwin/macOS installed libiconv does not accept // trailers on
conversion codes; this causes the init_iconv to fail - and then
that SEGVs later.
Remove the trailing // as it is not needed elsewhere.
Also print a warning if we fail to init the conversion.
gcc/cobol/ChangeLog:
* symbols.cc : Remove trailing // on standard_internal.
(cbl_field_t::internalize): Print a warning if we fail to
initialise iconv.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
-rw-r--r-- | gcc/cobol/symbols.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cobol/symbols.cc b/gcc/cobol/symbols.cc index 5043125..4067459 100644 --- a/gcc/cobol/symbols.cc +++ b/gcc/cobol/symbols.cc @@ -3567,7 +3567,7 @@ cbl_field_t::is_ascii() const { * compilation, if it moves off the default, it adjusts only once, and * never reverts. */ -static const char standard_internal[] = "CP1252//"; +static const char standard_internal[] = "CP1252"; extern os_locale_t os_locale; static const char * @@ -3595,6 +3595,10 @@ cbl_field_t::internalize() { static iconv_t cd = iconv_open(tocode, fromcode); static const size_t noconv = size_t(-1); + if (cd == (iconv_t)-1) { + yywarn("failed iconv_open tocode = '%s' fromcode = %s", tocode, fromcode); + } + // Sat Mar 16 11:45:08 2024: require temporary environment for testing if( getenv( "INTERNALIZE_NO") ) return data.initial; |