Message ID | 87bnyw41hf.fsf@kepler.schwinge.homeip.net |
---|---|
State | New |
Headers | show |
On Tue, Jan 28, 2014 at 6:36 AM, Thomas Schwinge <thomas@codesourcery.com> wrote: > Avoid "'dc' may be uninitialized" warning. > > libiberty/ > * cp-demangle.c (d_demangle_callback): Put __builtin_unreachable > in place, to help the compiler. > > --- libiberty/cp-demangle.c > +++ libiberty/cp-demangle.c > @@ -5824,6 +5824,8 @@ d_demangle_callback (const char *mangled, int options, > NULL); > d_advance (&di, strlen (d_str (&di))); > break; > + default: > + __builtin_unreachable (); You can't call __builtin_unreachable in this code, because libiberty in stage 1 will be compiled by the host compiler and __builtin_unreachable is specific to GCC. This patch is OK if you call abort instead of __builtin_unreachable. Thanks. Ian
--- libiberty/cp-demangle.c +++ libiberty/cp-demangle.c @@ -5824,6 +5824,8 @@ d_demangle_callback (const char *mangled, int options, NULL); d_advance (&di, strlen (d_str (&di))); break; + default: + __builtin_unreachable (); } /* If DMGL_PARAMS is set, then if we didn't consume the entire