[Top][All Lists]

[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:26:25 +0200

On Sun, Dec 12, 2010 at 03:05, Andrew W. Nosenko
<address@hidden> wrote:
> 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!

Another possibility is that it's not you misunderstand or doesn't
understand my point, but it's I don't understand or misunderstand

If interpret your mail not as

    "cpp is pretty tied to cc and any mismatch gives The Bad Thing,
for example you may give the wrong LONG_MAX",

but as

    "you should write (as much as possible) on the fault-tolerant
manner and doesn't depend (as much as possible) that your cpp+cc pair
is bug free and, for example, didn't lied to you about actual LONG_MAX

then all pieces of puzzle hits own place and all becomes much clearer :-)

Andrew W. Nosenko <address@hidden>

reply via email to

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