C++ PATCH: Bug in ?: operator

Mark Mitchell mark@codesourcery.com
Fri Aug 27 08:01:00 GMT 1999


Nathan --

  The changes to convert_arg_to_ellipsis and the recreation of the
warnings in build_conditional_expr are fine.  Consider them approved.

  I'm concerned about the rest of this patch, and I need to have you
help me reload some context.  Let's do that ASAP; then I'll approve
the patch, and then we can get on with life.  :-)

  I need a pointer to the place in the standard where it says that
writing `*((void*) 0)' is legal, and where it says that values under
casts-to-void are thrown away, rather than never calculated.  I
vaguely remember you having this discussion a few months back, but I
don't remember *why* the outcome was decided the way that it was.  A
one-paragraph capsule summary with pointers to the standard would be
really helpful.  I'm surprised by the semantics here, which seem to
indicate that `(void) *vp' does not `use' the volatile storage, but
that `(void) f()' does require a call to `f'.  It's odd that we should
get one kind of side-effects and not the other.

  I'm sure you're right; I just need to know why.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


More information about the Gcc-patches mailing list