bugGNU roff - Bugs: bug #63509, ctime(3) is obsolescent

 
 

bug #63509: ctime(3) is obsolescent

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Sun 11 Dec 2022 10:38:46 PM UTC
   
 
Category:  General Severity:  2 - Minor
Item Group:  Lint Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 27 Dec 2022 09:24:13 AM UTC, comment #3: 


commit 6ab057057b4d91d57eb541bc28965f05896571a9
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sun Dec 25 17:06:21 2022 -0600

    [docs]: Fix Savannah #63509.

    * doc/groff.texi (Invoking groff, Built-in Registers):
    * man/groff.7.man (Writable predefined registers):
    * src/roff/groff/groff.1.man (Environment):
    * src/roff/troff/troff.1.man (Environment): Replace erroneous reference
      to ctime(3) with localtime(3).

    Fixes <https://savannah.gnu.org/bugs/?63509>.  Thanks to Bjarni Ingi
    Gislason for the report.


G. Branden Robinson <gbranden>
Group administrator
Sun 25 Dec 2022 11:07:27 PM UTC, comment #2: 

There was a section number typo in our Texinfo manual, so I'm going ahead and doing this.

G. Branden Robinson <gbranden>
Group administrator
Mon 12 Dec 2022 10:49:45 PM UTC, comment #1: 


original submission:

> Subject: ctime(3) is obsolescent
>
> See ctime(3) (POSIX.1-2008) and
> www.open-std.org/JTC1/SC22/WG14/www/docs/n3047.pdf.


Okay.  That doesn't change the fact that it's familiar to a lot of C programmers, which is the point (in the documentation).
 

>   Used in
>
> devices/grohtml/grohtml.1.man:.MR ctime 3
> devices/grohtml/post-html.cpp:   .put_string(ctime(&t), strlen(ctime(&t))-1)
> devices/grohtml/post-html.cpp:      .put_string(ctime(&t), strlen(ctime(&t))-1)
> devices/grops/grops.1.man:.MR ctime 3
> devices/grops/ps.cpp:    fputs(ctime(&t), out.get_file());
> roff/groff/groff.1.man:.MR ctime 3
> roff/troff/troff.1.man:.MR ctime 3


The man page references and HTML output driver code can likely switch to `localtime()`.
 

>   The mentioning of "ctime(3)" in man pages ("SOURCE_DATE_EPOCH") is
> irrelevant (implementation detail which can change and thus cause lost
> time by updating that).


Yes, it's an implementation detail that may change; the key fact to communicate is that groff doesn't compute the wall clock time for itself, but relies upon the operating environment.

And I reject entirely any suggestion that "SOURCE_DATE_EPOCH" (and "TZ") are irrelevant.  Perhaps you missed the discussion and/or the NEWS item about their importance.


o The semantics of the environment variable SOURCE_DATE_EPOCH (support
  for which was added in 1.22.4) to groff were not established with
  respect to time zone selection, prompting divergent interpretations;
  Debian and distributions derived from it have for several years
  patched groff to implicitly use UTC as the time zone when interpreting
  the current time (or SOURCE_DATE_EPOCH) as a local time.  While a
  convenient and defensible choice for reproducible build efforts, it
  runs against the grain of user expectations.  Systems programmers like
  time zone-invariant, monotonically increasing clocks; the broader
  user base usually prefers a clock that follows an applicable civil
  calendar.  groff programs now reckon SOURCE_DATE_EPOCH with respect to
  the local time zone.  Users of SOURCE_DATE_EPOCH may wish to also set
  the TZ environment variable.


G. Branden Robinson <gbranden>
Group administrator
Sun 11 Dec 2022 10:38:46 PM UTC, original submission:  

Subject: ctime(3) is obsolescent

See ctime(3) (POSIX.1-2008) and
www.open-std.org/JTC1/SC22/WG14/www/docs/n3047.pdf.

  Used in

devices/grohtml/grohtml.1.man:.MR ctime 3
devices/grohtml/post-html.cpp:   .put_string(ctime(&t), strlen(ctime(&t))-1)
devices/grohtml/post-html.cpp:      .put_string(ctime(&t), strlen(ctime(&t))-1)
devices/grops/grops.1.man:.MR ctime 3
devices/grops/ps.cpp:    fputs(ctime(&t), out.get_file());
roff/groff/groff.1.man:.MR ctime 3
roff/troff/troff.1.man:.MR ctime 3

  The mentioning of "ctime(3)" in man pages ("SOURCE_DATE_EPOCH") is
irrelevant (implementation detail which can change and thus cause lost
time by updating that).

Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-12-27 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2022-12-25 gbranden StatusPostponed In Progress
        Assigned toNone gbranden
        Planned ReleaseNone 1.23.0
    2022-12-12 gbranden Severity3 - Normal 2 - Minor
    2022-12-12 gbranden Item GroupNone Lint
        StatusNone Postponed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code