All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org,  Michael Roth <michael.roth@amd.com>,
	 Kevin Wolf <kwolf@redhat.com>,
	 Laurent Vivier <laurent@vivier.eu>,
	 Warner Losh <imp@bsdimp.com>,  Kyle Evans <kevans@freebsd.org>,
	 Hanna Reitz <hreitz@redhat.com>,
	 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	 Fam Zheng <fam@euphon.net>,  Eric Blake <eblake@redhat.com>,
	 "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	 qemu-block@nongnu.org
Subject: Re: [PATCH 9/9] scripts/qapi: add required system includes to visitor
Date: Thu, 23 Jun 2022 15:43:20 +0200	[thread overview]
Message-ID: <87h74bfqbr.fsf@pond.sub.org> (raw)
In-Reply-To: <20220616124034.3381391-10-marcandre.lureau@redhat.com> (marcandre lureau's message of "Thu, 16 Jun 2022 16:40:34 +0400")

marcandre.lureau@redhat.com writes:

> From: Marc-André Lureau <marcandre.lureau@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.lureau@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.



  reply	other threads:[~2022-06-23 13:44 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 12:40 [PATCH 0/9] Preliminary patches for subproject split marcandre.lureau
2022-06-16 12:40 ` [PATCH 1/9] monitor: make error_vprintf_unless_qmp() static marcandre.lureau
2022-07-07 12:23   ` Markus Armbruster
2022-07-07 17:35     ` Marc-André Lureau
2022-07-08 13:56       ` Markus Armbruster
2022-07-08 14:10         ` Marc-André Lureau
2022-06-16 12:40 ` [PATCH 2/9] error-report: misc comment fix marcandre.lureau
2022-06-20  7:22   ` Markus Armbruster
2022-06-16 12:40 ` [PATCH 3/9] error-report: introduce "detailed" variable marcandre.lureau
2022-06-20  7:22   ` Markus Armbruster
2022-06-16 12:40 ` [PATCH 4/9] error-report: simplify print_loc() marcandre.lureau
2022-06-20  7:24   ` Markus Armbruster
2022-06-16 12:40 ` [PATCH 5/9] error-report: introduce ErrorReportDetailedFunc marcandre.lureau
2022-06-16 18:28   ` Warner Losh
2022-07-07 12:11   ` Markus Armbruster
2022-07-07 18:06     ` Marc-André Lureau
2022-06-16 12:40 ` [PATCH 6/9] error-report: add a callback to overwrite error_vprintf marcandre.lureau
2022-07-07 12:16   ` Markus Armbruster
2022-07-07 18:05     ` Marc-André Lureau
2022-07-12  9:32       ` Marc-André Lureau
2022-06-16 12:40 ` [PATCH 7/9] qapi: move QEMU-specific dispatch code in monitor marcandre.lureau
2022-06-16 12:40 ` [PATCH 8/9] scripts/qapi-gen: add -i option marcandre.lureau
2022-06-21 14:13   ` Markus Armbruster
2022-06-23  8:10     ` Marc-André Lureau
2022-08-02 13:27       ` Markus Armbruster
2022-08-03  7:42         ` Marc-André Lureau
2022-08-03 11:16           ` Markus Armbruster
2022-06-16 12:40 ` [PATCH 9/9] scripts/qapi: add required system includes to visitor marcandre.lureau
2022-06-23 13:43   ` Markus Armbruster [this message]
2022-07-04 14:55     ` Marc-André Lureau
2022-06-16 13:12 ` [PATCH 0/9] Preliminary patches for subproject split Paolo Bonzini
2022-06-16 13:20   ` Marc-André Lureau
2022-06-28  8:15 ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h74bfqbr.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=imp@bsdimp.com \
    --cc=kevans@freebsd.org \
    --cc=kwolf@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=marcandre.lureau@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@yandex-team.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.