https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124616
--- Comment #22 from Steve Kargl <kargl at gcc dot gnu.org> ---
(In reply to Xavier Del Campo Romero from comment #21)
> (In reply to Steve Kargl from comment #20)
> > (In reply to James K. Lowden from comment #19)
> > > Yesterday's 66f4ed06fcbd3a1f24b4f4fdb177d0d51f9a9cd1 included a drive-by
> > > fix
> > > for O_LARGEFILE. Please indicate if that resolves this issue or if more
> > > yet
> > > needs to be done for FreeBSD.
> >
> > Yes, the build of gcobol on x86_64-*-freebsd is now fixed.
> >
> > 'gmake check-cobol' yields
> >
> > === cobol Summary ===
> >
> > # of expected passes 7739
> > # of unexpected failures 96
> > # of expected failures 78
> > # of unresolved testcases 60
> >
> > Several of the failures are of the form
> >
> > FAIL: cobol.dg/group2/CBL_CHECK_FILE_EXIST.cob -O0 (internal compiler
> > error: datetime_format_of:123: DATETIME-FMT: empty (sub)expression)
> >
> >
> > I'll open new bug reports as I investigate the failures.
>
> Could you please confirm whether the following patch solves the issue?
>
> diff --git a/gcc/cobol/scan_post.h b/gcc/cobol/scan_post.h
> index a60abfa8ecf..dcdcfdb9cdb 100644
> --- a/gcc/cobol/scan_post.h
> +++ b/gcc/cobol/scan_post.h
> @@ -87,7 +87,7 @@ datetime_format_of( const char input[] ) {
> static const char date_fmt_e[] = "YYYY-MM-DD|YYYY-DDD|YYYY-Www-D";
>
> static const char time_fmt_b[] =
> - "hhmmss([.,]s+)?|hhmmss([.,]s+)?Z|hhmmss([.,]s+)?[+]hhmm|";
> + "hhmmss([.,]s+)?|hhmmss([.,]s+)?Z|hhmmss([.,]s+)?[+]hhmm";
> static const char time_fmt_e[] =
> "hh:mm:ss([.,]s+)?|hh:mm:ss([.,]s+)?Z|hh:mm:ss([.,]s+)?[+]hh:mm";
Yes, that fixed the DATETIME-FMT failures.
=== cobol Summary ===
# of expected passes 7938
# of unexpected failures 36
# of expected failures 78
# of unresolved testcases 30
/home/kargl/gcc/obj/gcc/gcobol version 17.0.0 20260915 (experimental) (GCC)
gmake[1]: [Makefile:4806: check-cobol] Error 1 (ignored)
gmake[1]: Leaving directory '/home/kargl/gcc/obj/gcc'