Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Sep 2018 11:11:32 +0000
From:      bugzilla-noreply@freebsd.org
To:        standards@FreeBSD.org
Subject:   [Bug 231425] Fix C11 and POSIX 1003.1b-1993 compliance in time.h
Message-ID:  <bug-231425-99@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231425

            Bug ID: 231425
           Summary: Fix C11 and POSIX 1003.1b-1993 compliance in time.h
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: standards
          Assignee: standards@FreeBSD.org
          Reporter: sghctoma@gmail.com

Created attachment 197167
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D197167&action=
=3Dedit
patch to make time.h C11 and POSIX 1003.1b-1993 compliant

The problems:
 - struct timespec is only visible if _POSIX_C_SOURCE >=3D 199309 even thou=
gh it
is in the C11 standard (ISO/IEC 9899:201x 7.27.1)
 - timespec_get is not behind any feature test macros, but it is only defin=
ed
in C11 (ISO/IEC 9899:201x 7.27.2.5)

Related headers:
 - time.h: includes timespec.h if _POSIX_C_SOURCE >=3D 19930, defines
timespec_get and TIME_UTC unconditionally
 - timespec.h: defines some BSD-specific macros, itimerspec, and includes
_timespec.h
 - _timespec.h: defines struct timespec

A summary of which symbols are defined in which standard:
 - itimerspec: POSIX 1003.1b-1993
 - timespec: POSIX 1003.1b-1993, C11
 - timespec_get: C11
 - TIME_UTC: C11

The patch:
I did not really know what would be the proper approach to fix this, so I w=
ent
with a solution that does not require touching _timespec.h and timespec.h. =
The
attached patch puts timespec_get and TIME_UTC behind __STDC_VERSION__ >=3D
201112L guard. It also includes _timespec.h inside that guard, so we get st=
ruct
timespec.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-231425-99>