gcc/doc: adjust __builtin_choose_expr() description

Message ID 2c4bdf0f-de92-4210-b04f-881283888192@suse.com
State New
Headers
Series gcc/doc: adjust __builtin_choose_expr() description |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Test passed

Commit Message

Jan Beulich June 19, 2024, 2:01 p.m. UTC
  Present wording has misled people to believe the ?: operator would be
evaluating all three of the involved expressions.

gcc/

	* doc/extend.texi: Clarify __builtin_choose_expr() similarity to
	the ?: operator.
  

Patch

--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -14962,9 +14962,9 @@  struct {
 
 This built-in function is analogous to the @samp{? :} operator in C,
 except that the expression returned has its type unaltered by promotion
-rules.  Also, the built-in function does not evaluate the expression
-that is not chosen.  For example, if @var{const_exp} evaluates to @code{true},
-@var{exp2} is not evaluated even if it has side effects.
+rules.  Like the @samp{? :} operator, the built-in function does not evaluate
+the expression that is not chosen.  For example, if @var{const_exp} evaluates
+to @code{true}, @var{exp2} is not evaluated even if it has side effects.
 
 This built-in function can return an lvalue if the chosen argument is an
 lvalue.