qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [RFC][PATCH v5 01/21] Move code related to fd handl


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] Re: [RFC][PATCH v5 01/21] Move code related to fd handlers into utility functions
Date: Wed, 8 Dec 2010 09:23:21 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

On Wed, Dec 08, 2010 at 10:17:50AM +0100, Jes Sorensen wrote:
> On 12/08/10 10:15, Stefan Hajnoczi wrote:
> > On Tue, Dec 07, 2010 at 04:02:03PM +0100, Jes Sorensen wrote:
> >> Anything to avoid qemu_set_fd_handler17() at some point. I think using
> >> __qemu_set_fd_handler() encourages people to modify that code rather
> >> than copy it.
> > 
> > I agree that qemu_set_fd_handler3() could be named something more
> > meaningful.  Unfortunately we can't use __qemu_set_fd_handler() because
> > the C language standard reserves identifiers that start with double
> > underscore for the standard library.  The Linux kernel gets away with it
> > because the code is freestanding but that doesn't apply to QEMU.
> 
> Hmmm you sure that is actually a rule, rather than a convention?
> 
> Either way, we can use 3 underscores, or leave the function static, in
> which case the C library names are a non issue.

>From 7.1.3 Reserved identifiers:

"All identifiers that begin with an underscore and either an uppercase
letter or another underscore are always reserved for any use."

and

"All identifiers that begin with an underscore are always reserved for
use as identifiers with file scope in both the ordinary and tag name
spaces."

That includes three or more underscores too.

Stefan



reply via email to

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