From: bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r@public.gmane.org
To: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [Bug 46731] New: difftime(3) may suggest that time_t can be a non-arithmetic type
Date: Thu, 30 Aug 2012 19:25:09 +0000 (UTC) [thread overview]
Message-ID: <bug-46731-11311@https.bugzilla.kernel.org/> (raw)
https://bugzilla.kernel.org/show_bug.cgi?id=46731
Summary: difftime(3) may suggest that time_t can be a
non-arithmetic type
Product: Documentation
Version: unspecified
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: man-pages
AssignedTo: documentation_man-pages-ztI5WcYan/vQLgFONoPN62D2FQJk+8+b@public.gmane.org
ReportedBy: mgorny-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org
Regression: No
Created an attachment (id=78851)
--> (https://bugzilla.kernel.org/attachment.cgi?id=78851)
Patch changing the wording to the more exact problem
The difftime(3) manpage[1] states:
NOTES
On a POSIX system, time_t is an arithmetic type, and one could just
define
#define difftime(t1,t0) (double)(t1 - t0)
when the possible overflow in the subtraction is not a concern. On
other
systems, the data type time_t might use some other encoding where
subtraction doesn't work directly.
---
When I first read this, I got confused that time_t may actually be a
non-arithmetic type. But the C99 standard explicitly lists (in 7.23.1):
3 The types declared are size_t (described in 7.17); clock_t and time_t which
are arithmetic types capable of representing times
---
I think that particular paragraphs should be re-worked to explicitly state what
differences can arise in time_t implementations and what is the reason that
they can't be used to compute time differences. As far as I understand, the
only issue is that time_t can express time in units other than seconds.
I'm attaching a patch with my wording for that.
[1]:http://man7.org/linux/man-pages/man3/difftime.3.html
--
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2012-08-30 19:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-30 19:25 bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r [this message]
[not found] ` <bug-46731-11311-3bo0kxnWaOQUvHkbgXJLS5sdmw4N0Rt+2LY78lusg7I@public.gmane.org/>
2012-12-21 16:30 ` [Bug 46731] difftime(3) may suggest that time_t can be a non-arithmetic type bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-46731-11311@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon-590eeb7gvniway/ihj7yzeb+6bgklq7r@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).