Re: Hi ! help please

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

 



question in this phrase

IS-5.17/1 - Assignment operators
There are several assignment operators, all of which group
right-to-left. All require a modifiable lvalue as their left operand,
and the type of an assignment expression is that of its left operand.
The result of the assignment operation is the value stored in the left
operand after the assignment has taken place; the result is an lvalue.

...

exactly when the "assignment" would be "taken place"
howling and there were doubts whether it is correct.

On Sat, Jan 2, 2016 at 8:16 PM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
> On 2 January 2016 at 13:26, Vincent Diepeveen wrote:
>>
>> Assuming function f() has been defined
>> Comparing 2 different types is undefined in C.
>
> That's completely untrue, I have no idea where you got that idea. Look
> up "integer promotion".
>
>> Note that compilers that optimize better than GCC, say intel c++ which is
>> 10% - 30% faster for many of my codes, statistical odds it goes wrong is
>> higher than GCC.
>
> Nonsense.
>
>> In assembler it could for example XOR just register ah, which is a 8 bits
>> register and then further you compare register aex with another value.
>>
>> So the other 24 bits of that register might have some random value.
>
> Nonsense.
>
>> In 64 bits it's even bigger problem also with gcc.
>> I write lots of 64 bits codes.
>>
>> unsigned long long x;
>> If( x == 0 ) // undefined behaviour also in GCC
>
> It's undefined behaviour because 'x' is uninitialized, but not because
> the types are different.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux