xemu/scripts
Peter Maydell 83ecb22ba2 scripts/qapi-types.py: Add dummy member to empty structs
Make sure that all generated C structs have at least one field; this
avoids potential issues with attempting to malloc space for
zero-length structs in C (g_malloc(sizeof struct) would return NULL).
It also avoids an incompatibility with C++ (where an empty struct is
size 1); that isn't important to us now but might be in future.

Generated empty structures look like this:
    struct Abort
    {
        char qapi_dummy_field_for_empty_struct;
    };

This silences clang warnings like:
./qapi-types.h:3752:1: warning: empty struct has size 0 in C, size 1 in C++ [-Wextern-c-compat]
struct Abort
^

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1419359069-16611-1-git-send-email-peter.maydell@linaro.org
2015-01-20 15:19:32 +00:00
..
2014-10-31 16:36:23 +01:00
2014-02-20 13:14:18 +01:00
2012-03-30 08:14:11 -05:00
2014-06-27 09:27:56 -04:00
2012-03-24 12:57:02 +00:00
2012-04-16 15:41:20 +02:00
2014-02-15 16:10:25 +04:00
2012-03-24 14:10:25 +00:00
2014-06-09 15:43:40 +02:00