qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] HACKING: remove bogus restrictions


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH] HACKING: remove bogus restrictions
Date: Tue, 28 Aug 2012 20:21:46 +0300

On Tue, Aug 28, 2012 at 05:13:24PM +0000, Blue Swirl wrote:
> On Tue, Aug 28, 2012 at 4:01 PM, Michael S. Tsirkin <address@hidden> wrote:
> > We copied HACKING from libvirt but it has some bogus stuff:
> > neither underscore capital, double underscore, or underscore 't' suffixes
> > are reserved in Posix/C: this appears to be based on misreading of the
> > C standard. Using sane prefixes is enough to avoid conflicts.
> >
> > These rules are also widely violated in our codebase,
> > and it does not make sense to rework it all, apparently for
> > no benefit.
> 
> NACK. The benefit is improved standards compliance. One day we could
> find QEMU being ported to environment which conflicts with these
> symbols.

We are talking about stuff like __kvm_pv_eoi - so the chance is exactly 0.
And if it does happen then you run a simple script and fix
this one instance.

> The tiny single benefit from violating the rules would be that you
> could use a few additional possible classes of prefixes, in addition
> to the infinite combinations already available.

Benefit would be consistency with existing QEMU code
which has both _t __  and _X, and consistency
within HACKING itself.

> >
> > Signed-off-by: Michael S. Tsirkin <address@hidden>
> > ---
> >  HACKING | 4 ----
> >  1 file changed, 4 deletions(-)
> >
> > diff --git a/HACKING b/HACKING
> > index 471cf1d..0a941fc 100644
> > --- a/HACKING
> > +++ b/HACKING
> > @@ -69,10 +69,6 @@ it points to, or it is aliased to another pointer that 
> > is.
> >  2.3. Typedefs
> >  Typedefs are used to eliminate the redundant 'struct' keyword.
> >
> > -2.4. Reserved namespaces in C and POSIX
> > -Underscore capital, double underscore, and underscore 't' suffixes should 
> > be
> > -avoided.
> > -
> >  3. Low level memory management
> >
> >  Use of the malloc/free/realloc/calloc/valloc/memalign/posix_memalign
> > --
> > MST



reply via email to

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