Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jonathan Wakely
On 20/04/17 12:20 +0100, Jonathan Wakely wrote: On 20/04/17 11:12 +0100, Jonathan Wakely wrote: On 20/04/17 12:07 +0200, Jakub Jelinek wrote: On Thu, Apr 20, 2017 at 11:03:38AM +0100, Jonathan Wakely wrote: Yet another case where warning suppression in system headers hurts the library's abilit

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Pedro Alves
On 04/20/2017 10:39 AM, Jonathan Wakely wrote: > > Or simply deprecate support for it in std::atomic. **If** the > extension for built-in types is useful then I can imagine it might be > useful to have it for std::atomic too, for a subset of the programs > relying on the original extension. But I'

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jonathan Wakely
On 20/04/17 11:12 +0100, Jonathan Wakely wrote: On 20/04/17 12:07 +0200, Jakub Jelinek wrote: On Thu, Apr 20, 2017 at 11:03:38AM +0100, Jonathan Wakely wrote: Yet another case where warning suppression in system headers hurts the library's ability to give diagnostics. We can't warn about using

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jonathan Wakely
On 20/04/17 12:07 +0200, Jakub Jelinek wrote: On Thu, Apr 20, 2017 at 11:03:38AM +0100, Jonathan Wakely wrote: Yet another case where warning suppression in system headers hurts the library's ability to give diagnostics. We can't warn about using incomplete types in std::unique_ptr because the -

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jakub Jelinek
On Thu, Apr 20, 2017 at 11:03:38AM +0100, Jonathan Wakely wrote: > Yet another case where warning suppression in system headers hurts the > library's ability to give diagnostics. We can't warn about using > incomplete types in std::unique_ptr because the -Wdelete-incomplete > warning gets suppresse

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jonathan Wakely
On 20/04/17 11:57 +0200, Florian Weimer wrote: On 04/20/2017 11:52 AM, Jonathan Wakely wrote: On 20/04/17 11:43 +0200, Florian Weimer wrote: On 04/20/2017 11:25 AM, Jonathan Wakely wrote: I mean, with -pedantic-errors we already error on void * arighmetics or function pointer arithmetics. If

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Florian Weimer
On 04/20/2017 11:52 AM, Jonathan Wakely wrote: On 20/04/17 11:43 +0200, Florian Weimer wrote: On 04/20/2017 11:25 AM, Jonathan Wakely wrote: I mean, with -pedantic-errors we already error on void * arighmetics or function pointer arithmetics. If std::atomic would use the void * arithmetics, i

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jonathan Wakely
On 20/04/17 11:48 +0200, Florian Weimer wrote: On 04/20/2017 11:39 AM, Jonathan Wakely wrote: Or simply deprecate support for it in std::atomic. **If** the extension for built-in types is useful then I can imagine it might be useful to have it for std::atomic too, for a subset of the programs re

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jonathan Wakely
On 20/04/17 11:43 +0200, Florian Weimer wrote: On 04/20/2017 11:25 AM, Jonathan Wakely wrote: I mean, with -pedantic-errors we already error on void * arighmetics or function pointer arithmetics. If std::atomic would use the void * arithmetics, it would also reject it. Or does it use integer

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Florian Weimer
On 04/20/2017 11:39 AM, Jonathan Wakely wrote: Or simply deprecate support for it in std::atomic. **If** the extension for built-in types is useful then I can imagine it might be useful to have it for std::atomic too, for a subset of the programs relying on the original extension. But I'm unconvi

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Florian Weimer
On 04/20/2017 11:25 AM, Jonathan Wakely wrote: I mean, with -pedantic-errors we already error on void * arighmetics or function pointer arithmetics. If std::atomic would use the void * arithmetics, it would also reject it. Or does it use integer arithmetics instead? No, it does it on void*,

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jonathan Wakely
On 20/04/17 10:31 +0100, Jonathan Wakely wrote: On 20/04/17 11:24 +0200, Florian Weimer wrote: On 04/20/2017 11:22 AM, Jonathan Wakely wrote: On 20/04/17 10:18 +0100, Jonathan Wakely wrote: On 20/04/17 08:19 +0200, Florian Weimer wrote: On 04/19/2017 07:07 PM, Jonathan Wakely wrote: I know i

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Marc Glisse
On Thu, 20 Apr 2017, Florian Weimer wrote: On 04/19/2017 07:07 PM, Jonathan Wakely wrote: I know it's a bit late, but I'd like to propose deprecating the libstdc++ extension that allows arithmetic on std::atomic. Currently we make it behave like arithmetic on void*, which is also a GNU extensio

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jonathan Wakely
On 20/04/17 11:24 +0200, Florian Weimer wrote: On 04/20/2017 11:22 AM, Jonathan Wakely wrote: On 20/04/17 10:18 +0100, Jonathan Wakely wrote: On 20/04/17 08:19 +0200, Florian Weimer wrote: On 04/19/2017 07:07 PM, Jonathan Wakely wrote: I know it's a bit late, but I'd like to propose deprecati

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jakub Jelinek
On Thu, Apr 20, 2017 at 10:25:40AM +0100, Jonathan Wakely wrote: > In theory maybe. > > > I mean, with -pedantic-errors we already error on void * arighmetics > > or function pointer arithmetics. If std::atomic would use > > the void * arithmetics, it would also reject it. Or does it use integer

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jonathan Wakely
On 20/04/17 10:25 +0100, Jonathan Wakely wrote: On 20/04/17 11:21 +0200, Jakub Jelinek wrote: On Thu, Apr 20, 2017 at 10:18:09AM +0100, Jonathan Wakely wrote: On 20/04/17 08:19 +0200, Florian Weimer wrote: On 04/19/2017 07:07 PM, Jonathan Wakely wrote: > I know it's a bit late, but I'd like to

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jonathan Wakely
On 20/04/17 11:21 +0200, Jakub Jelinek wrote: On Thu, Apr 20, 2017 at 10:18:09AM +0100, Jonathan Wakely wrote: On 20/04/17 08:19 +0200, Florian Weimer wrote: > On 04/19/2017 07:07 PM, Jonathan Wakely wrote: > > I know it's a bit late, but I'd like to propose deprecating the > > libstdc++ extensi

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Florian Weimer
On 04/20/2017 11:22 AM, Jonathan Wakely wrote: On 20/04/17 10:18 +0100, Jonathan Wakely wrote: On 20/04/17 08:19 +0200, Florian Weimer wrote: On 04/19/2017 07:07 PM, Jonathan Wakely wrote: I know it's a bit late, but I'd like to propose deprecating the libstdc++ extension that allows arithmeti

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jonathan Wakely
On 20/04/17 10:18 +0100, Jonathan Wakely wrote: On 20/04/17 08:19 +0200, Florian Weimer wrote: On 04/19/2017 07:07 PM, Jonathan Wakely wrote: I know it's a bit late, but I'd like to propose deprecating the libstdc++ extension that allows arithmetic on std::atomic. Currently we make it behave li

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jakub Jelinek
On Thu, Apr 20, 2017 at 10:18:09AM +0100, Jonathan Wakely wrote: > On 20/04/17 08:19 +0200, Florian Weimer wrote: > > On 04/19/2017 07:07 PM, Jonathan Wakely wrote: > > > I know it's a bit late, but I'd like to propose deprecating the > > > libstdc++ extension that allows arithmetic on std::atomic.

Re: Deprecating arithmetic on std::atomic

2017-04-20 Thread Jonathan Wakely
On 20/04/17 08:19 +0200, Florian Weimer wrote: On 04/19/2017 07:07 PM, Jonathan Wakely wrote: I know it's a bit late, but I'd like to propose deprecating the libstdc++ extension that allows arithmetic on std::atomic. Currently we make it behave like arithmetic on void*, which is also a GNU exten

Re: Deprecating arithmetic on std::atomic

2017-04-19 Thread Florian Weimer
On 04/19/2017 07:07 PM, Jonathan Wakely wrote: I know it's a bit late, but I'd like to propose deprecating the libstdc++ extension that allows arithmetic on std::atomic. Currently we make it behave like arithmetic on void*, which is also a GNU extension (https://gcc.gnu.org/onlinedocs/gcc/Pointer

Re: Deprecating arithmetic on std::atomic

2017-04-19 Thread Ville Voutilainen
On 19 April 2017 at 20:07, Jonathan Wakely wrote: > I know it's a bit late, but I'd like to propose deprecating the > libstdc++ extension that allows arithmetic on std::atomic. > Currently we make it behave like arithmetic on void*, which is also a > GNU extension (https://gcc.gnu.org/onlinedocs/g

Deprecating arithmetic on std::atomic

2017-04-19 Thread Jonathan Wakely
I know it's a bit late, but I'd like to propose deprecating the libstdc++ extension that allows arithmetic on std::atomic. Currently we make it behave like arithmetic on void*, which is also a GNU extension (https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html). We also allow arithmetic on types