ape/cc: accept -p flag; time.h: add timezone_t; patch: add time_rz#152
Conversation
cc.c: -p (profiling flag) now passes through to native compiler like -w/-F/-N/-T instead of printing 'flag ignored'. time.h: add timezone_t as a forward-declared opaque type (POSIX.1-2024). Uses 'struct tm_zone *' with __timezone_t_defined guard so gnulib packages that define the full struct remain compatible. patch/mkfile: add time_rz.$O to LIBO — parse-datetime.c calls tzalloc/tzfree/localtime_rz/mktime_z which are provided by time_rz.c. https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
There was a problem hiding this comment.
Code Review
This pull request introduces POSIX.1-2024 compliance by defining the timezone_t type in time.h, adds support for the -p flag in the cc compiler wrapper, and updates the patch utility's build configuration to include time_rz. Feedback suggests that the timezone_t definition in time.h should be accompanied by function prototypes for tzalloc, tzfree, localtime_rz, and mktime_z to prevent implicit declaration warnings.
| /* POSIX.1-2024: opaque timezone handle used by tzalloc/tzfree/localtime_rz */ | ||
| #ifndef __timezone_t_defined | ||
| struct tm_zone; | ||
| typedef struct tm_zone *timezone_t; | ||
| #define __timezone_t_defined 1 | ||
| #endif |
There was a problem hiding this comment.
The addition of timezone_t for POSIX.1-2024 compliance is correct, but the associated function prototypes (tzalloc, tzfree, localtime_rz, and mktime_z) are missing. Since the PR description mentions that parse-datetime.c calls these functions, they should be declared here to avoid implicit declaration warnings or errors. Additionally, mktime_z should be included in the descriptive comment.
| /* POSIX.1-2024: opaque timezone handle used by tzalloc/tzfree/localtime_rz */ | |
| #ifndef __timezone_t_defined | |
| struct tm_zone; | |
| typedef struct tm_zone *timezone_t; | |
| #define __timezone_t_defined 1 | |
| #endif | |
| /* POSIX.1-2024: opaque timezone handle used by tzalloc/tzfree/localtime_rz/mktime_z */ | |
| #ifndef __timezone_t_defined | |
| struct tm_zone; | |
| typedef struct tm_zone *timezone_t; | |
| #define __timezone_t_defined 1 | |
| timezone_t tzalloc(const char *); | |
| void tzfree(timezone_t); | |
| struct tm *localtime_rz(timezone_t, const time_t *, struct tm *); | |
| time_t mktime_z(timezone_t, struct tm *); | |
| #endif |
cc.c: -p (profiling flag) now passes through to native compiler like -w/-F/-N/-T instead of printing 'flag ignored'.
time.h: add timezone_t as a forward-declared opaque type (POSIX.1-2024). Uses 'struct tm_zone *' with __timezone_t_defined guard so gnulib packages that define the full struct remain compatible.
patch/mkfile: add time_rz.$O to LIBO — parse-datetime.c calls tzalloc/tzfree/localtime_rz/mktime_z which are provided by time_rz.c.
https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs