Re: [PATCH 0/4] drop some "int x = x" hacks to silence gcc warnings
- From
Joachim Schmitz <jojo@schmitz-digital.de>
- Date
- Mar 21, 2013, 13:44 UTC
- Message-ID
- <kif2so$2ug$1@ger.gmane.org>
- In-Reply-To
- <514AF2E1.7020409@viscovery.net>
Johannes Sixt wrote:
Show 8 quoted lines
> Am 3/21/2013 12:03, schrieb Jeff King: >> I was fooling around with clang and noticed that it complains about >> the "int x = x" construct under -Wall. That is IMHO a deficiency in >> clang, since the idiom has a well-defined use in silencing >> -Wuninitialized warnings. > > IMO, that's a myth. The construct invokes undefined behavior at least > since C99, and the compilers are right to complain about it.
And I complained about this a couple months ago, as the compiler on HP-NonStop stumbles across this too (by emitting a warning)
Bye, Jojo