[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/47] qlit: Change compound literals to initializers
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL 07/47] qlit: Change compound literals to initializers |
Date: |
Fri, 1 Sep 2017 14:55:31 +0200 |
From: Marc-André Lureau <address@hidden>
The QLIT_QFOO() macros expand into compound literals. Sadly, gcc
doesn't recognizes these as constant expressions (clang does), which
makes the macros useless for initializing objects with static storage
duration.
There is a gcc bug about it:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71713
Change the macros to expand into initializers.
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
[Commit message improved]
Signed-off-by: Markus Armbruster <address@hidden>
---
include/qapi/qmp/qlit.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/qlit.h
index a4ad91321b..f1d6eed317 100644
--- a/include/qapi/qmp/qlit.h
+++ b/include/qapi/qmp/qlit.h
@@ -36,13 +36,13 @@ struct QLitDictEntry {
};
#define QLIT_QNUM(val) \
- (QLitObject){.type = QTYPE_QNUM, .value.qnum = (val)}
+ { .type = QTYPE_QNUM, .value.qnum = (val) }
#define QLIT_QSTR(val) \
- (QLitObject){.type = QTYPE_QSTRING, .value.qstr = (val)}
+ { .type = QTYPE_QSTRING, .value.qstr = (val) }
#define QLIT_QDICT(val) \
- (QLitObject){.type = QTYPE_QDICT, .value.qdict = (val)}
+ { .type = QTYPE_QDICT, .value.qdict = (val) }
#define QLIT_QLIST(val) \
- (QLitObject){.type = QTYPE_QLIST, .value.qlist = (val)}
+ { .type = QTYPE_QLIST, .value.qlist = (val) }
int compare_litqobj_to_qobj(QLitObject *lhs, QObject *rhs);
--
2.13.5
- [Qemu-devel] [PULL 04/47] qdict: Add qdict_put_null() helper, and put it to use, (continued)
- [Qemu-devel] [PULL 04/47] qdict: Add qdict_put_null() helper, and put it to use, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 16/47] qapi-schema: Document how generated documentation is ordered, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 14/47] qlit: Tighten QLit dict vs QDict comparison, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 01/47] qapi: Fix error handling code on alternate conflict, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 03/47] qobject: Explain how QNum works, and why, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 13/47] tests/check-qlit: New, covering qobject/qlit.c, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 05/47] qlit: move qlit from check-qjson to qobject/, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 17/47] qapi-schema: Introspection doc is in the wrong section, fix, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 10/47] qlit: make qlit_equal_qobject() take const arguments, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 29/47] qapi-schema: Make block-core.json self-contained, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 07/47] qlit: Change compound literals to initializers,
Markus Armbruster <=
- [Qemu-devel] [PULL 31/47] qapi-schema: Improve section headings, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 41/47] qapi: Use qapi_enum_parse() in input_type_enum(), Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 06/47] qlit: use QLit prefix consistently, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 32/47] qapi: Update qapi-code-gen.txt examples to match current code, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 26/47] qapi-schema: Collect TPM stuff in qapi/tpm.json, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 18/47] qapi-schema: Rocker doc section contains unrelated stuff, fix, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 02/47] tests/qmp-test: Add generic, basic test of query commands, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 33/47] qapi: Drop superfluous qapi_enum_parse() parameter max, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 27/47] qapi-schema: Move block events from event.json to block.json, Markus Armbruster, 2017/09/01
- [Qemu-devel] [PULL 37/47] hmp: Use qapi_enum_parse() in hmp_migrate_set_parameter(), Markus Armbruster, 2017/09/01