From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqNDw-0008Gx-TB for qemu-devel@nongnu.org; Thu, 07 May 2015 10:56:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqNDu-0008RP-6N for qemu-devel@nongnu.org; Thu, 07 May 2015 10:56:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqNDu-0008RJ-1q for qemu-devel@nongnu.org; Thu, 07 May 2015 10:56:26 -0400 Message-ID: <554B7D13.10603@redhat.com> Date: Thu, 07 May 2015 16:56:19 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1430999444-24315-1-git-send-email-quintela@redhat.com> <554B7A1D.1060807@redhat.com> In-Reply-To: <554B7A1D.1060807@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 00/16] Migration pull request (v2) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Peter Maydell , Juan Quintela Cc: QEMU Developers On 07/05/2015 16:43, Eric Blake wrote: > > I wonder if include/qemu/atomic.h could enhance the #define wrappers to > add no-op compile-time checking, something like (untested): > > #define atomic_add(ptr, n) do { \ > QEMU_BUILD_BUG_ON(sizeof(ptr) > sizeof(void*)); \ > __sync_fetch_and_add(ptr, 1); \ > } while (0) Yes, though it would have to be a statement expression rather than a do...while. Paolo