|
From: Matt B. <wal...@ma...> - 2024-07-11 16:41:29
|
> On Jul 11, 2024, at 9:26 AM, Greg Troxel <gd...@le...> wrote:
>
> Solomon Peachy via Gimp-print-devel
> <gim...@li...> writes:
>
>> On Wed, Jul 10, 2024 at 08:26:56PM -0400, Greg Troxel wrote:
>>> Strictly, a program should specify --std=cNN for the variant it is
>>> written in. But I think the default -- so far -- is almost always c99
>>> so often this doesn't happen.
>>
>> gcc jumped from 'gnu89' straight to 'gnu11' and currently defaults to
>> 'gnu17'. At no point did GCC ever default to c99 (or gnu99).
>
> Wow, but I learn something new every day. Anyway, I think we'll all
> happy with --std=c99.
>
>>> I ran make check, and it passed ppds and is still going.
>>
>> This will take some hours depending on the speed of your system.
>
> It took 12 hours, and that's on a 9th-gen i7! But I got a clean pass.
>
>> What does 'man strdup' and 'man localtime_r' list as requirements for
>> use on these problematic platforms?
>
> On NetBSD, strdup says the following (leaving out stuff in the middle)
> and it works without any defines.
>
> SYNOPSIS
> #include <string.h>
>
> char *
> strdup(const char *str);
>
> char *
> strndup(const char *str, size_t len);
>
> STANDARDS
> The strdup() function conforms to IEEE Std 1003.1-2001 (“POSIX.1”).
>
> HISTORY
> The strdup() function first appeared in 4.4BSD. The strndup() function
> was added in NetBSD 4.0.
>
> man localtime_r says:
>
> SYNOPSIS
> #include <time.h>
>
> struct tm *
> localtime_r(const time_t * restrict clock, struct tm * restrict result);
>
> STANDARDS
> The ctime(), difftime(), asctime(), localtime(), gmtime() and mktime()
> functions conform to ANSI X3.159-1989 (“ANSI C89”). Rest of the
> functions conform to IEEE Std 1003.1-2008 (“POSIX.1”).
>
macos 12.7.5 responds as--
man strdup
NAME
strdup, strndup – save a copy of a string
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <string.h>
char *
strdup(const char *s1);
char *
strndup(const char *s1, size_t n);
DESCRIPTION
The strdup() function allocates sufficient memory for a copy of the string
s1, does the copy, and returns a pointer to it. The pointer may
subsequently be used as an argument to the function free(3).
If insufficient memory is available, NULL is returned and errno is set to
ENOMEM.
The strndup() function copies at most n characters from the string s1
always NUL terminating the copied string.
SEE ALSO
free(3), malloc(3)
HISTORY
The strdup() function first appeared in 4.4BSD. The strndup() function was
added in FreeBSD 7.2.
macOS 12.7 December 5, 2008 macOS 12.7
=======================================
man localtime_r
CTIME(3) Library Functions Manual CTIME(3)
NAME
asctime, asctime_r, ctime, ctime_r, difftime, gmtime, gmtime_r, localtime,
localtime_r, mktime, timegm, timelocal – transform binary date and time
values
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <time.h>
extern char *tzname[2];
char *
asctime(const struct tm *timeptr);
...
SEE ALSO
date(1), gettimeofday(2), getenv(3), time(3), tzset(3), tzfile(5)
STANDARDS
The asctime(), ctime(), difftime(), gmtime(), localtime(), and mktime()
functions conform to ISO/IEC 9899:1990 (“ISO C90”), and conform to ISO/IEC
9945-1:1996 (“POSIX.1”) provided the selected local timezone does not
contain a leap-second table (see zic(8)).
The asctime_r(), ctime_r(), gmtime_r(), and localtime_r() functions are
expected to conform to ISO/IEC 9945-1:1996 (“POSIX.1”) (again provided the
selected local timezone does not contain a leap-second table).
The timegm() function is not specified by any standard; its function cannot
be completely emulated using the standard functions described above.
HISTORY
This manual page is derived from the time package contributed to Berkeley
by Arthur Olson and which appeared in 4.3BSD.
BUGS
Except for difftime(), mktime(), and the _r() variants of the other
functions, these functions leaves their result in an internal static object
and return a pointer to that object. Subsequent calls to these function
will modify the same object.
The C Standard provides no mechanism for a program to modify its current
local timezone setting, and the POSIX-standard method is not reentrant.
(However, thread-safe implementations are provided in the POSIX threaded
environment.)
The tm_zone field of a returned tm structure points to a static array of
characters, which will also be overwritten by any subsequent calls (as well
as by subsequent calls to tzset(3) and tzsetwall(3)).
Use of the external variable tzname is discouraged; the tm_zone entry in
the tm structure is preferred.
macOS 12.7 January 2, 1999 macOS 12.7
Matt
|