qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] error handling: Use TFR() macro where applicable


From: Peter Maydell
Subject: Re: [PATCH] error handling: Use TFR() macro where applicable
Date: Thu, 18 Aug 2022 15:11:48 +0100

On Thu, 18 Aug 2022 at 15:07, Christian Schoenebeck
<qemu_oss@crudebyte.com> wrote:
>
> On Mittwoch, 17. August 2022 17:55:24 CEST Peter Maydell wrote:
> > On Wed, 17 Aug 2022 at 15:49, Nikita Ivanov <nivanov@cloudlinux.com> wrote:
> > > Well...
> > >
> > > What exactly is still under discussion? In my perspective, the main
> > > pitfalls have been resolved:
> > >
> > > 0. All possible places where TFR() macro could be applied are covered.
> > > 1. Macro has been renamed in order to be more transparent. The name has
> > > been chosen in comparison with a similar glibc macro. 2. The macro itself
> > > has been refactored, in order to replace it entirely with glibc
> > > alternative. 3. Problems with statement/expressions differences in qemu
> > > and glibc implementation have been resolved.
> > >
> > > Is there any room for improvement?
> >
> > (a) do we want the statement version or the expression version?
>
> I think the tendency was in favour for the expression version? Markus made it
> clear that the glibc version indeed may evaluate as an expression (GCC
> extension).

Sounds good to me.

> > (b) do we want "use the glibc one, with same-semantics version for
> > compatibility", or do we want "we have our own thing"?
> >
> > I would have voted for following glibc, except that it does
> > that cast-to-long thing, which is incorrect behaviour when
> > long is 32 bits and the return value from the function being
> > tested is 64 bits.
>
> Then simply int64_t as a type instead, and as "our own thing"?

I think this is probably what I would go for, except that we
should use typeof() rather than a specific type.

Then we get to bikeshed the macro name again :-)

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]