[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 01/16] x86: Convert conditional compilation o
From: |
Marc Marí |
Subject: |
Re: [Qemu-devel] [PATCH v2 01/16] x86: Convert conditional compilation of debug printfs to regular ifs |
Date: |
Thu, 15 May 2014 11:56:11 +0200 |
El Tue, 13 May 2014 08:38:26 -0600
Eric Blake <address@hidden> escribió:
> Although __VA_ARGS__ is required by C99, the use of ##__VA_ARGS__ is a
> gcc extension; are you sure that all other supported compilers handle
> it? (I guess that's just clang)
>
> If you want something portable to C99, just use one fewer macro
> argument, so that you are guaranteed that __VA_ARGS__ will be
> non-empty (that is, subsume fmt into the ...):
>
> #define DEBUG(...) \
> QEMU_DPRINTF(DEVICE_ASSIGNMENT_DEBUG_ENABLED, \
> "pci_assign", __VA_ARGS__)
>
I found some problems to convert from ## __VA_ARGS__ to __VA_ARGS__ in
some parts, and as I asked in IRC, it was pointed that "our HACKING
document recommends the fmt, ## __VA_ARGS__ approach, and it obviously
works on all the compilers we care about". So I will leave this as it
is now.
Marc
- [Qemu-devel] [PATCH v2 00/16] Convert conditional compilation of debug printfs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 01/16] x86: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 02/16] s390: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 03/16] scsi: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 04/16] highbank: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 05/16] xilinx: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 07/16] stellaris: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13