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
|
||
|---|---|---|
| .. | ||
| kvm | ||
| qemu-guest-agent | ||
| qmp | ||
| tracetool | ||
| acpi_extract.py | ||
| acpi_extract_preprocess.py | ||
| analyse-9p-simpletrace.py | ||
| check-qerror.sh | ||
| checkpatch.pl | ||
| cleanup-trace-events.pl | ||
| coverity-model.c | ||
| create_config | ||
| disas-objdump.pl | ||
| dump-guest-memory.py | ||
| extract-vsssdk-headers | ||
| feature_to_c.sh | ||
| get_maintainer.pl | ||
| gtester-cat | ||
| hxtool | ||
| make-release | ||
| make_device_config.sh | ||
| ordereddict.py | ||
| qapi-commands.py | ||
| qapi-event.py | ||
| qapi-types.py | ||
| qapi-visit.py | ||
| qapi.py | ||
| qemu-binfmt-conf.sh | ||
| qemu-gdb.py | ||
| refresh-pxe-roms.sh | ||
| signrom.py | ||
| simpletrace.py | ||
| switch-timer-api | ||
| texi2pod.pl | ||
| tracetool.py | ||
| update-acpi.sh | ||
| update-linux-headers.sh | ||
| vmstate-static-checker.py | ||