This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/16293] __attribute__(([non-]const)): optimization bug?


------- Additional Comments From giovannibajo at libero dot it  2004-06-30 11:09 -------
It does not matter, short-circuiting of conditionals is always allowed. This 
lets us write code like "if (f && f->a == 0)", which otherwise would crash when 
f is NULL.

For the specific case, see [expr.log.and]/1 in the C++ standard: "Unlike &, && 
guarantees left-to-right evaluation: the second operand is not evaluated if the 
first operand is false."

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16293


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]