James Carlson <[EMAIL PROTECTED]> wrote:

> > >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);
>
> That would mean "the strchr function takes a pointer to character
> argument, it does not modify the storage pointed to, and the value it
> returns has the same storage qualifiers as the first argument."

If the #pragma only affects the storage attributes (as I intended with
my proposal), I believe the #pragma is a good idea. I believe that this
coild even be made an extension of Sun Studio to help the development
of clean code.

Jörg

-- 
 EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin
       [EMAIL PROTECTED]                (uni)  
       [EMAIL PROTECTED]     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to