[Top][All Lists]
[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 21:00:23 +0300 |
On Tue, Aug 28, 2012 at 06:46:53PM +0100, Peter Maydell wrote:
> On 28 August 2012 18:32, Michael S. Tsirkin <address@hidden> wrote:
> > What about _t in POSIX? That seems fairly safe if name is long and qemu
> > specific enough.
>
> Depends what you mean by "safe". The spec says "don't use this";
> it isn't any different to the __ and _[A-Z] prohibitions in that
> respect.
It's different: unlike C compiler POSIX can not mangle
names in an application. So it will not internally
create qemu_foo_bar_t from qemu_foo_bar, and thus
qemu_foo_bar_t is very unlikely to create conflicts.
OTOH compiler people do mysterious and strange things
to the point where you do not want to mess with them
if you can.
> Other posix namespace landgrabs you may not have expected:
> * ctype.h reserves "is[a-z]" and to[a-z]" prefixes
> * string.h takes "str[a-z]" and "mem[a-z]" prefixes
>
> (and qemu-common.h includes both string.h and ctype.h so this
> effectively applies to all of qemu).
>
> I'm in two minds about these, because on the one hand they're
> reserved but on the other hand abiding by the rules makes things
> uglier (whereas "use one underscore not two" doesn't produce
> an uglier name IMHO).
>
> (posix also if I'm reading it correctly reserves all of 'prefix
> underscore', which is annoying.)
>
> -- PMM
Exactly my points.
--
MST
Re: [Qemu-devel] [PATCH] HACKING: remove bogus restrictions, Blue Swirl, 2012/08/28
Re: [Qemu-devel] [PATCH] HACKING: remove bogus restrictions, Andreas Färber, 2012/08/28