[DOC PATCH] Clarify docs about stmt exprs (PR c/51088)

Marek Polacek polacek@redhat.com
Fri Mar 28 14:48:00 GMT 2014


PR51088 contains some Really Bizzare code.  We should tell users
not to do any shenanigans like that.

Ok for trunk?

2014-03-28  Marek Polacek  <polacek@redhat.com>

	PR c/51088
	* doc/extend.texi (Statement Exprs): Add note about taking
	addresses of labels inside of statement expressions.

diff --git gcc/doc/extend.texi gcc/doc/extend.texi
index f9114ab..215d0a2 100644
--- gcc/doc/extend.texi
+++ gcc/doc/extend.texi
@@ -206,6 +206,9 @@ Jumping into a statement expression with @code{goto} or using a
 @code{case} or @code{default} label inside the statement expression is
 not permitted.  Jumping into a statement expression with a computed
 @code{goto} (@pxref{Labels as Values}) has undefined behavior.
+Taking the address of a label declared inside of a statement
+expression from outside of the statement expression has undefined
+behavior.
 Jumping out of a statement expression is permitted, but if the
 statement expression is part of a larger expression then it is
 unspecified which other subexpressions of that expression have been

	Marek



More information about the Gcc-patches mailing list