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:          needs-pullups
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 28 14:35:00 +0000 2024
>Closed-Date:    
>Last-Modified:  Thu Aug 29 01:55:01 +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

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(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.