On Tue, Aug 28, 2012 at 06:46:53PM +0100, Peter Maydell wrote: > On 28 August 2012 18:32, Michael S. Tsirkin <m...@redhat.com> 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