Re: [PATCH v3] MSVC: fix t0040-parse-options crash
- From
Jeff King <peff@peff.net>
- Date
- Mar 31, 2014, 21:09 UTC
- Message-ID
- <20140331210956.GB6422@sigill.intra.peff.net>
- In-Reply-To
- <m2wqfcm6nj.fsf@linux-m68k.org>
On Sun, Mar 30, 2014 at 10:29:04AM +0200, Andreas Schwab wrote:
Show 9 quoted lines
> Junio C Hamano <gitster@pobox.com> writes: > > > As OPT_SET_PTR() is about setting the pointer value to intptr_t defval, > > a follow-up patch on top of this fix (see attached) may not be a bad > > thing to have, but that patch alone will not fix this issue without > > dropping the unneeded and unwanted cast to unsigned long. > > Wouldn't it make sense to change defval into a union to avoid the cast? > (The intptr_t type may be too narrow for other values to be put there.)
The primary function of these structs is to capture the information found in brace initializers. Is it possible in C89 to initialize the second member of a union (I think in C99, you can use named initializers).
-Peff