On Thu, Mar 23, 2006 at 10:51:01PM +0100, Roland Mainz wrote: > James Carlson wrote: > > [EMAIL PROTECTED] writes: > > > >typeof(arg1) > > > >strchr(const char *, char) > > > > > > > >or something similar that would carry the actual input over to the return > > > >value. > > > > > > It would soon give you C++ type overloading. Might not be bad, but you > > > know where to find C++ :-) > > > > A good subset of the functionality (which I agree is a bit troublesome > > in that generic formulation) would be to allow storage qualifiers > > alone (not full types) to leak through functions. Something like: > > > > #pragma storage_return strchr(1) > > char *strchr(const char *, int); > > Offtopic: Did anyone thought yet about having namespaces for #pragma > stuff ? For example: > #pragma vnd.sun::storage_return strchr(1) // for the (vendor) Sun > specific statement above > #pragma org.openmp::foobar // for OpenMP-specific stuff > and so on. Currently all the different #pragma stuff in one flat > namespace is a horrible portability issue and people rarely use #ifdef > to protect these statements correctly. Is there someone at Sun who's > interested to discuss solutions and carry them forth to the ISO-C > working group ?
As an aside, note that dtrace's D (which can process C headers) has all of its pragmas of the form: #pragma D pragma_name... so that it has its own namespace. Cheers, - jonathan -- Jonathan Adams, Solaris Kernel Development _______________________________________________ opensolaris-discuss mailing list opensolaris-discuss@opensolaris.org