Re: I'm getting a "operation on xxx may be undefined" error in GCC 4.5.1 that I didn't use to get in 4.3.4

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

 



Staffan Tjernstrom <stjernstrom@xxxxxxx> writes:

>>The PHYSICAL_ADDR macro uses its argument twice.  You are passing an
>>assignment statement to PHYSICAL_ADDR.  The effect is that you are
>>assigning to p_parent twice in a single expression.  In C/C++ assigning
>>to the same variable more than once in a single expression is undefined
>>behaviour.  This warning is controlled by -Wsequence-point, q.v.
>
> Thanks, that clarifies the scenario (although in this case the RHS of the multiple assign is the same in both cases AFAICT ...)

To be clear, the fact that the RHS is the same is irrelevant.  C/C++
says that assigning to the same LHS twice in a single expression is
undefined, regardless of what the LHS is being set to.

Ian


[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