https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119975
Bug ID: 119975 Summary: clock_gettime in genapi.cc is unportable Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: cobol Assignee: unassigned at gcc dot gnu.org Reporter: ro at gcc dot gnu.org CC: iains at gcc dot gnu.org, jklowden at gcc dot gnu.org, rdubner at gcc dot gnu.org Target Milestone: --- Host: x86_64-apple-darwin11.4.2, x86_64-apple-darwin15.6.0 When I recently tried to build cobol on Mac OS X 10.7, and 10.11, it failed: /vol/gcc/src/hg/master/darwin/gcc/cobol/genapi.cc:10290:5: error: 'clock_gettime' was not declared in this scope 10290 | clock_gettime(CLOCK_REALTIME, &tp); // time_t tv_sec; long tv_nsec | ^~~~~~~~~~~~~ /vol/gcc/src/hg/master/darwin/gcc/cobol/genapi.cc:10290:19: error: 'CLOCK_REALTIME' was not declared in this scope 10290 | clock_gettime(CLOCK_REALTIME, &tp); // time_t tv_sec; long tv_nsec | ^~~~~~~~~~~~~~ I wonder why it's done this way: there are other places in the frontends that determine the current time already, like timevar.cc (get_time).