Skip to content

ape/cc: accept -p flag; time.h: add timezone_t; patch: add time_rz#152

Merged
staalmannen merged 1 commit into
mainfrom
claude/upgrade-ape-c-library-mmZGd
May 23, 2026
Merged

ape/cc: accept -p flag; time.h: add timezone_t; patch: add time_rz#152
staalmannen merged 1 commit into
mainfrom
claude/upgrade-ape-c-library-mmZGd

Conversation

@staalmannen

Copy link
Copy Markdown
Owner

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

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
@staalmannen staalmannen merged commit 932d99d into main May 23, 2026
1 check passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread sys/include/ape/time.h
Comment on lines +113 to +118
/* 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
/* 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants