NetBSD Problem Report #58651
From www@netbsd.org Wed Aug 28 14:32:09 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 35BDB1A9245
for <gnats-bugs@gnats.NetBSD.org>; Wed, 28 Aug 2024 14:32:09 +0000 (UTC)
Message-Id: <20240828142707.D39981A9247@mollari.NetBSD.org>
Date: Wed, 28 Aug 2024 14:27:07 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: tm(3): wrong type in man page for tm_gmtoff
X-Send-Pr-Version: www-1.0
>Number: 58651
>Category: lib
>Synopsis: tm(3): wrong type in man page for tm_gmtoff
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: riastradh
>State: closed
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Wed Aug 28 14:35:00 +0000 2024
>Closed-Date: Sun Oct 13 20:28:30 +0000 2024
>Last-Modified: Sun Oct 13 20:28:30 +0000 2024
>Originator: Taylor R Campbell
>Release: current, 10, 9, ...
>Organization:
The NetGMT Longoffset
>Environment:
>Description:
The tm(3) man page says:
In addition, the following NetBSD-specific fields are available:
Type Field Represents
int tm_gmtoff Offset from UTC in seconds
__aconst char tm_zone Timezone abbreviation
However, tm_gmtoff has been long, not int, since this file was updated from 4.4-Lite in 1994. (I would see if it went back any further, but I can't because the earlier history was scrubbed as required by the settlement in the AT&T lawsuit.)
Also, the __aconst is superfluous here. It is used only for special builds of NetBSD that serve to verify we don't accidentally write to pointers that are supposed to be const but can't be exposed as such for whatever standards compliance reasons.
>How-To-Repeat:
code manspection
>Fix:
Yes, please!
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: lib-bug-people->riastradh
Responsible-Changed-By: riastradh@NetBSD.org
Responsible-Changed-When: Wed, 28 Aug 2024 14:36:53 +0000
Responsible-Changed-Why:
mine
State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Wed, 28 Aug 2024 14:36:53 +0000
State-Changed-Why:
fixed in HEAD, needs pullup-10 and pullup-9
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58651 CVS commit: src/share/man/man3
Date: Wed, 28 Aug 2024 14:36:20 +0000
Module Name: src
Committed By: riastradh
Date: Wed Aug 28 14:36:19 UTC 2024
Modified Files:
src/share/man/man3: tm.3
Log Message:
tm(3): Fix types in man page.
PR lib/58651: tm(3): wrong type in man page for tm_gmtoff
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man3/tm.3
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: lib/58651: tm(3): wrong type in man page for tm_gmtoff
Date: Thu, 29 Aug 2024 08:52:15 +0700
Date: Wed, 28 Aug 2024 14:35:00 +0000 (UTC)
From: campbell+netbsd@mumble.net
Message-ID: <20240828143500.8DDBF1A9249@mollari.NetBSD.org>
| (I would see if it went back any further, but I can't because the
| earlier history was scrubbed
It was always long, since it was added in sccs version 1.2, 1987-03-04
jacaranda$ sccs sccsdiff -r1.1 -r1.2 time.h
------- time.h -------
1c1,7
< /* %M% %I% %E% */
---
> /*
> * Copyright (c) 1983, 1987 Regents of the University of California.
> * All rights reserved. The Berkeley software License Agreement
> * specifies the terms and conditions for redistribution.
> *
> * %W% (Berkeley) %G%
> */
15a22,23
> long tm_gmtoff;
> char *tm_zone;
The end of line comments (which spelled "UTC" as "CUT" on the tm_gmtoff line)
were added in the next revision (5.1), 1989-03-08 (to those two lines, and
all the others, and also put in a more modern style copyright notice).
The CUT error wasn't fixed in the NetBSD tree until rev 1.25, 2000-07-06.
It is long in POSIX as well.
However:
campbell+netbsd@mumble.net said:
| Also, the __aconst is superfluous here.
["here" is the tm_zone field definition.]
Probably, though in this case it should be turned into const
instead of just deleted. tm_zone should also (obviously really) be
a char *, not char. If anything in our code, anywhere, cannot handle it
being a const char *, that should be fixed (but the __aconst probably
already provided assurance that there is nowhere that will be needed.)
And since those two fields are now specified in POSIX, the:
"In addition, the following NetBSD-specific fields are available"
should be deleted now, along with the nonsense about "only if arrangements
were made ... and no guarantee these fields will continue to exist",
and the STANDARDS section updated to indicate it conforms with
IEEE Std 1003.1-2024 (still POSIX.1).
kre
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58651 CVS commit: src/share/man/man3
Date: Sun, 13 Oct 2024 01:30:45 +0000
Module Name: src
Committed By: riastradh
Date: Sun Oct 13 01:30:45 UTC 2024
Modified Files:
src/share/man/man3: tm.3
Log Message:
tm(3): Fix type of tm_zone again, and describe it as const.
It is `char *', not `char'. But it's also not supposed to be written
to, as kre@ noted, so just document it as `const' even though it's
technically not declared that way, presumably for expedience of
managing it with malloc/free internally.
PR lib/58651: tm(3): wrong type in man page for tm_gmtoff
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man3/tm.3
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Sun, 13 Oct 2024 01:38:44 +0000
State-Changed-Why:
pullup-10 #966 https://releng.netbsd.org/cgi-bin/req-10.cgi?show=966
pullup-9 #1908 https://releng.netbsd.org/cgi-bin/req-9.cgi?show=1908
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58651 CVS commit: [netbsd-10] src/share/man/man3
Date: Sun, 13 Oct 2024 15:20:49 +0000
Module Name: src
Committed By: martin
Date: Sun Oct 13 15:20:49 UTC 2024
Modified Files:
src/share/man/man3 [netbsd-10]: tm.3
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #966):
share/man/man3/tm.3: revision 1.6
share/man/man3/tm.3: revision 1.7
tm(3): Fix types in man page.
PR lib/58651: tm(3): wrong type in man page for tm_gmtoff
tm(3): Fix type of tm_zone again, and describe it as const.
It is `char *', not `char'. But it's also not supposed to be written
to, as kre@ noted, so just document it as `const' even though it's
technically not declared that way, presumably for expedience of
managing it with malloc/free internally.
PR lib/58651: tm(3): wrong type in man page for tm_gmtoff
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.2.1 src/share/man/man3/tm.3
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58651 CVS commit: [netbsd-9] src/share/man/man3
Date: Sun, 13 Oct 2024 15:22:04 +0000
Module Name: src
Committed By: martin
Date: Sun Oct 13 15:22:04 UTC 2024
Modified Files:
src/share/man/man3 [netbsd-9]: tm.3
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1908):
share/man/man3/tm.3: revision 1.6
share/man/man3/tm.3: revision 1.7
tm(3): Fix types in man page.
PR lib/58651: tm(3): wrong type in man page for tm_gmtoff
tm(3): Fix type of tm_zone again, and describe it as const.
It is `char *', not `char'. But it's also not supposed to be written
to, as kre@ noted, so just document it as `const' even though it's
technically not declared that way, presumably for expedience of
managing it with malloc/free internally.
PR lib/58651: tm(3): wrong type in man page for tm_gmtoff
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.46.1 src/share/man/man3/tm.3
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: pending-pullups->closed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Sun, 13 Oct 2024 20:28:30 +0000
State-Changed-Why:
fixed in HEAD, pulled up to 9 and 10
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.