On Fri, May 24, 2019 at 11:20:48AM -0700, Gerd Rausch wrote: > Hi Jason, > > On 24/05/2019 08.07, Jason Gunthorpe wrote: > > On Thu, May 23, 2019 at 11:14:42PM -0700, Gerd Rausch wrote: > > > >> I can't say that I'm thrilled with this behavior though, > >> as it appears error-prone: > >> As soon as an enum value goes out of range for an "int", the > >> type silently changes, potentially rendering structures and functions silently incompatible. > >> It's quite the pitfall (e.g. the foo.c vs bar.c case above). > > > > Indeed, I would be very careful using this extension with > > non-anonymous enums :) > > > > However, an anonymous enum can never have storage allocated, so it > > doesn't experience any ABI concern. > > > > Sure it can: > > % cat foo.c > struct foo { > enum { FOO = 1UL << 31 } foo; > } foo = { FOO }; I meant top level anonymous enums :) Jason