On 10/05/2012 10:50 AM, Eric Blake wrote:
>> and are the two main headers that are this
>> explicit about various macros being suitable for use in preprocessor
>> arithmetic, and preprocessor arithmetic cannot use casts or sizeof.
>
> And I think this is a bug in POSIX
Never mind. I wasn't lo
On 10/05/2012 10:17 AM, Eric Blake wrote:
> On 10/05/2012 10:06 AM, Andreas Schwab wrote:
>> Chet Ramey writes:
>>
>>> Why would you say there's a restriction against using casts or sizeof in
>>> a macro like this?
>>
>> Because it must expand to a valid preprocessor expression.
>
> C99 5.2.4.2.1
On 10/05/2012 10:06 AM, Andreas Schwab wrote:
> Chet Ramey writes:
>
>> Why would you say there's a restriction against using casts or sizeof in
>> a macro like this?
>
> Because it must expand to a valid preprocessor expression.
C99 5.2.4.2.1
Sizes of integer types
1. The values given below
Chet Ramey writes:
> Why would you say there's a restriction against using casts or sizeof in
> a macro like this?
Because it must expand to a valid preprocessor expression.
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4
On 10/5/12 11:27 AM, Greg Wooledge wrote:
> On Fri, Oct 05, 2012 at 05:20:23PM +0200, Andreas Schwab wrote:
>> Greg Wooledge writes:
>>
>>> Line 1209 says:
>>> # if (ULLONG_MAX != LLONG_MAX)
>>>
>>> LLONG_MAX expands to:
>>> ((long long int) (~ (long long int) 0 - ((long long int) ((! ((long long
On Fri, Oct 05, 2012 at 05:20:23PM +0200, Andreas Schwab wrote:
> Greg Wooledge writes:
>
> > Line 1209 says:
> > # if (ULLONG_MAX != LLONG_MAX)
> >
> > LLONG_MAX expands to:
> > ((long long int) (~ (long long int) 0 - ((long long int) ((! ((long long
> > int) 0 < (long long int) -1)) ? ~ (long
Greg Wooledge writes:
> Line 1209 says:
> # if (ULLONG_MAX != LLONG_MAX)
>
> LLONG_MAX expands to:
> ((long long int) (~ (long long int) 0 - ((long long int) ((! ((long long int)
> 0 < (long long int) -1)) ? ~ (long long int) 0 << (sizeof (long long int) * 8
> - 1) : (long long int) 0
Tha