marcandre.lur...@redhat.com writes: > From: Marc-André Lureau <marcandre.lur...@redhat.com> > > The generated visitor code includes abort() & assert(), we shouldn't > rely on the global "-i" headers to include the necessary system headers.
Suggest ", even though the default qemu/osdep.h always does. > > Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> > --- > scripts/qapi/visit.py | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py > index 1ff464c0360f..d686df17f4b6 100644 > --- a/scripts/qapi/visit.py > +++ b/scripts/qapi/visit.py > @@ -326,6 +326,8 @@ def __init__(self, prefix: str, include: List[str]): > def _begin_builtin_module(self) -> None: > self._genc.preamble_add(mcgen(''' > %(include)s > +#include <assert.h> > +#include <stdlib.h> > > #include "qapi/error.h" > #include "qapi/qapi-builtin-visit.h" > @@ -342,6 +344,8 @@ def _begin_user_module(self, name: str) -> None: > visit = self._module_basename('qapi-visit', name) > self._genc.preamble_add(mcgen(''' > %(include)s > +#include <assert.h> > +#include <stdlib.h> > > #include "qapi/error.h" > #include "qapi/qmp/qerror.h" Mildly irritating, because we normally kill such includes as redundant on sight. The builtin module (qapi-builtin-visit.c) doesn't actually need these headers. I guess you include them just in case that changes.