This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Deprecating arithmetic on std::atomic<void*>
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, gcc at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Thu, 20 Apr 2017 11:30:25 +0200
- Subject: Re: Deprecating arithmetic on std::atomic<void*>
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AB8F13DBF9
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AB8F13DBF9
- References: <20170419170736.GY3412@redhat.com> <170e0b73-e561-82a9-7f26-e7b5d40a0f1c@redhat.com> <20170420091809.GA3412@redhat.com> <20170420092148.GO1809@tucnak> <20170420092540.GC3412@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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<void*> would use
> > the void * arithmetics, it would also reject it. Or does it use integer
> > arithmetics instead?
>
> No, it does it on void*, but the __atomic built-ins still perform that
> arithmetic even with -pedantic-errors.
Maybe that is what we should change, i.e. issue pedwarns similar to what we
emit on void * normal arithmetics for atomic/sync builtins that perform
arithmetics on void *, and error? for function pointer arithmetics.
Jakub