[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMe9rOrRdj_ns=rkonB2BwgmZa3KHBHTQQCv0bkH8PQ2UMXtHw@mail.gmail.com>
Date: Thu, 15 Mar 2012 15:19:44 -0700
From: "H.J. Lu" <hjl.tools@...il.com>
To: Paul Eggert <eggert@...ucla.edu>,
LKML <linux-kernel@...r.kernel.org>,
"H. Peter Anvin" <hpa@...or.com>
Cc: GNU C Library <libc-alpha@...rceware.org>
Subject: Re: PATCH [3/n]: Add __snseconds_t and __SNSECONDS_T_TYPE
On Thu, Mar 15, 2012 at 3:05 PM, Paul Eggert <eggert@...ucla.edu> wrote:
> On 03/15/2012 01:57 PM, H.J. Lu wrote:
>> What is the real consequence of using long long on tv_nsec,
>> except for not POSIX compliant? Will it lead to wrong code?
>
> It would break applications that do anything like this:
>
> struct timespec t;
> long *p = &t->tv_nsec;
>
> Such applications work fine now and conform to POSIX, but would
GCC will complain about "incompatible pointer type".
> either not compile or (worse) might compile and do the
> wrong thing, if tv_nsec were wider than 'long'.
We had a discussion on Linux kernel mailing list:
https://lkml.org/lkml/2012/2/8/408
We thought it was OK to have long long on tv_nsec.
--
H.J.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists