]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgcobol: Check for struct tm tm_zone
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 21 Apr 2025 13:59:14 +0000 (15:59 +0200)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 21 Apr 2025 13:59:14 +0000 (15:59 +0200)
commita619a128c992b2121a862b8470960ae751d25db6
treeb73a3bff945213a074ece8792f2e57e80cc206cc
parente1098c7b08d9e6018f60dae7a14c5ad621618223
libgcobol: Check for struct tm tm_zone

intrinsic.cc doesn't compile on Solaris:

/vol/gcc/src/hg/master/cobol/libgcobol/intrinsic.cc: In function ‘void
__gg__formatted_current_date(cblc_field_t*, cblc_field_t*, std::size_t,
std::size_t)’:
/vol/gcc/src/hg/master/cobol/libgcobol/intrinsic.cc:1480:6: error: ‘struct
std::tm’ has no member named ‘tm_zone’; did you mean ‘tm_mon’?
 1480 |   tm.tm_zone = "GMT";
      |      ^~~~~~~
      |      tm_mon

struct tm.tm_zone is new in POSIX.1-2024, thus cannot be assumed to be
present universally.

This patch checks for its presence and guards the use accordingly.

Bootstrapped without regressions on amd64-pc-solaris2.11,
sparcv9-sun-solaris2.11, and x86_64-pc-solaris2.11.

2025-04-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

libgcobol:
* configure.ac: Check for struct tm.tm_zone.
* configure, config.h.in: Regenerate.
* intrinsic.cc (__gg__formatted_current_date): Guard tm.tm_zone
use with HAVE_STRUCT_TM_TM_ZONE.
libgcobol/config.h.in
libgcobol/configure
libgcobol/configure.ac
libgcobol/intrinsic.cc