autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Arithmetic Shift


From: Andrew W. Nosenko
Subject: Re: Arithmetic Shift
Date: Sun, 12 Dec 2010 03:05:47 +0200

On Sat, Dec 11, 2010 at 22:09, Paul Eggert <address@hidden> wrote:
> On 12/11/2010 06:16 AM, Andrew W. Nosenko wrote:
>> You mismatch the preprocessor function (find the LONG_MAX macro and
>> replace it by it's definition found somewhere in header) with the
>> function of compiler (inject proper search path to the preprocessor if
>> compiler redefines some system's headers).
>>
>>> >
>>> > The situation with -1 >> 1 is similar.
>>> >
>> No, because replacement of macro by it's value is essentially
>> search-and-replace, while evaluation of arithmetics expressions is
>> essentially code interpretation.
>
> Sorry, I don't understand your point.  It seems to be
> claiming that the preprocessor doesn't do arithmetic

Of course it does :-)

> (a claim that is obviously incorrect), but your earlier
> comments suggest that you understand things well enough
> not to be making claims like that.

I'm arguing that in case of LONG_MAX example there no math at the
preprocessor side.  Plain string substitution.  Any evaluation, if
need, made latter by compiler.  Nothing bad will happen in this
example if cpp doesn't match cc.  At least while proper search path
passed for find limits.h (and therefore LONG_MAX define) that
corresponds the target architecture.

>From another hand, the #if -1>>1==-1 explicitly requires to evaluate
this expression by the cpp and there no other way for preprocessor for
do it's job than do this evaluation.

Therefore these cases (LONG_MAX vs #if -1>>1==-1) are not similar at
all.  First depends fully on the proper search paths and doesn't
depends on the preprocessor implementation at all.  Second absolutely
doesn't depend on the paths but fully depends on the preprocessor
implementation.

> Anyway, I don't think it matters.  We seem to be agreeing
> that autoconf isn't needed here.

Sure!

-- 
Andrew W. Nosenko <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]