Re: How can Autoconf help with the transition to stricter compilation defaults?

2022-11-17 Thread Michael Matz via cfe-commits
Hello, On Wed, 16 Nov 2022, Paul Eggert wrote: > On 2022-11-16 06:26, Michael Matz wrote: > > char foobar(void); > > int main(void) { > >return != 0; > > } > > That still has undefined behavior according to draft C23, This is correct (and also holds for the actually working variant later,

Re: How can Autoconf help with the transition to stricter compilation defaults?

2022-11-16 Thread Michael Matz via cfe-commits
Hello, On Wed, 16 Nov 2022, Jonathan Wakely wrote: > > > Unrelated but I was a bit tempted to ask for throwing in > > > -Wbuiltin-declaration-mismatch to default -Werror while Clang 16 was at > > > it, but I suppose we don't want the world to burn too much, > > > > :-) It's IMHO a bug in the

Re: How can Autoconf help with the transition to stricter compilation defaults?

2022-11-16 Thread Michael Matz via cfe-commits
Hello, On Wed, 16 Nov 2022, Sam James wrote: > Unrelated but I was a bit tempted to ask for throwing in > -Wbuiltin-declaration-mismatch to default -Werror while Clang 16 was at > it, but I suppose we don't want the world to burn too much, :-) It's IMHO a bug in the standard that it misses

Re: How can Autoconf help with the transition to stricter compilation defaults?

2022-11-16 Thread Michael Matz via cfe-commits
Hey, On Wed, 16 Nov 2022, Alexander Monakov wrote: > > The idea is so obvious that I'm probably missing something, why autoconf > > can't use that idiom instead. But perhaps the (historic?) reasons why it > > couldn't be used are gone now? > > Ironically, modern GCC and LLVM optimize ' != 0'

Re: How can Autoconf help with the transition to stricter compilation defaults?

2022-11-16 Thread Michael Matz via cfe-commits
Hi, On Tue, 15 Nov 2022, Paul Eggert wrote: > On 2022-11-15 11:27, Jonathan Wakely wrote: > > Another perspective is that autoconf shouldn't get in the way of > > making the C and C++ toolchain more secure by default. > > Can you cite any examples of a real-world security flaw what would be >

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-03-01 Thread Michael Matz via cfe-commits
Hi, On Mon, 29 Feb 2016, Jason Merrill wrote: > > Also this insistence that all of "trivially copyable" is already quite > > nicely specified in the C++ ABI is still not really relevant because > > C++ _is not the only language out there_. I'm not sure how often I > > have to repeat this

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-29 Thread Michael Matz via cfe-commits
Hi, On Fri, 26 Feb 2016, H.J. Lu wrote: > >> It is clear to me now. Let's go with > >> > >> --- > >> An empty type is a type where it and all of its subobjects (recursively) > >> are of class, structure, union, or array type. No memory slot nor > >> register should be used to pass or return an

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-23 Thread Michael Matz via cfe-commits
Hi, On Tue, 23 Feb 2016, H.J. Lu wrote: > > --- > > An empty type is a type where it and all of its subobjects (recursively) > > are of class, structure, union, or array type. No memory slot nor > > register should be used to pass or return an object of empty type that's > > trivially copyable.

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-22 Thread Michael Matz via cfe-commits
Hi, On Sat, 20 Feb 2016, Richard Smith wrote: > > An empty type is a type where it and all of its subobjects > > (recursively) are of class, structure, union, or array type. > > > > doesn't cover "trivially-copyable". > > That's correct. Whether a type is trivially copyable is unrelated to >

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-22 Thread Michael Matz via cfe-commits
Hi, On Fri, 19 Feb 2016, Richard Smith wrote: > >> > The trivially copyable is gone again. Why is it not necessary? > >> > >> The C++ ABI doesn't defer to the C psABI for types that aren't > >> trivially-copyable. See > >> http://mentorembedded.github.io/cxx-abi/abi.html#normal-call > > > >

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-19 Thread Michael Matz via cfe-commits
Hi, On Thu, 18 Feb 2016, H.J. Lu wrote: > >> An empty type is a type where it and all of its subobjects > >> (recursively) are of class, structure, union, or array type. No > >> memory slot nor register should be used to pass or return an object > >> of empty type. > > > > The trivially

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-19 Thread Michael Matz via cfe-commits
Hi, On Thu, 18 Feb 2016, Richard Smith wrote: > >> An empty type is a type where it and all of its subobjects > >> (recursively) are of class, structure, union, or array type. No > >> memory slot nor register should be used to pass or return an object > >> of empty type. > > > > The

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-18 Thread Michael Matz via cfe-commits
Hi, On Tue, 16 Feb 2016, H.J. Lu wrote: > Here is the new definition: > > An empty type is a type where it and all of its subobjects (recursively) > are of class, structure, union, or array type. No memory slot nor > register should be used to pass or return an object of empty type. The

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-11 Thread Michael Matz via cfe-commits
Hi, On Thu, 11 Feb 2016, H.J. Lu wrote: > Any suggestions on new wording, something like > > 1. "class type". A class type is a structure, union or C++ class. > 2. "empty type". An empty type is a type where it and all of its > subobjects are of class or array type. > > Does it cover >

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-11 Thread Michael Matz via cfe-commits
Hi, On Thu, 11 Feb 2016, Jonathan Wakely wrote: > On 11 February 2016 at 12:40, Matthijs van Duin wrote: > > You never define "POD for the purposes of layout", and I can only > > interpret it as being equivalent to "standard-layout". > > As Richard pointed out, it's defined in the C++ ABI.