[Bug c/89035] Request - builtins for unspecified and arbitrary values
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89035 Eric Gallager changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=91225 --- Comment #5 from Eric Gallager --- (In reply to Eric Gallager from comment #4) > (In reply to David Brown from comment #2) > > Yes, "int x = x;" does give an unspecified value without a warning. > > Really, not even one from -Winit-self? Martin Sebor explains in bug 91225 that "int x = x;" by itself is eliminated as unused; x would have to actually be used after that to get the -Winit-self warning.
[Bug c/89035] Request - builtins for unspecified and arbitrary values
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89035 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org --- Comment #4 from Eric Gallager --- (In reply to David Brown from comment #2) > Yes, "int x = x;" does give an unspecified value without a warning. Really, not even one from -Winit-self?
[Bug c/89035] Request - builtins for unspecified and arbitrary values
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89035 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment #3 from Martin Sebor --- Note that an uninitialized local variable has an indeterminate value which, even if it's not a trap representation, can appear to change from one instance to another, and whose use results in undefined behavior (see also https://gcc.gnu.org/ml/gcc/2019-01/msg00199.html).
[Bug c/89035] Request - builtins for unspecified and arbitrary values
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89035 --- Comment #2 from David Brown --- Yes, "int x = x;" does give an unspecified value without a warning. But to me, this looks much more like a workaround - while "int x = __builtin_unspecified();" is clear in its intentions.
[Bug c/89035] Request - builtins for unspecified and arbitrary values
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89035 --- Comment #1 from Marc Glisse --- We already have int x = x; for one of those, no? Or just int x; but it tends to warn.