Source-Changes-D archive

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

Re: CVS commit: src/share/man/man3

At Tue, 02 Mar 2010 07:57:42 +1100, matthew green <> 
Subject: re: CVS commit: src/share/man/man3
>    Module Name:       src
>    Committed By:      jruoho
>    Date:              Mon Mar  1 13:44:10 UTC 2010
>    Modified Files:
>       src/share/man/man3: Makefile
>    Added Files:
>       src/share/man/man3: __UNCONST.3
>    Log Message:
>    Document __UNCONST and __UNVOLATILE.
>    XXX: If there is anything to add or correct, please do so!
> could you use some stronger wording about avoiding using these unless
> absolutely necessary, and please note that they can also be used for
> variable assignment, not just for function calls.

Perhaps it would also be good to suggest correct ways to avoid "const"
mismatches in the first place, such as in variable assignments by
copying strings into non-const (eg. allocated) storage instead of
trying to assign pointers to them to a "char *".

I believe that __UNCONST() in particular is _never_ absolutely necessary
-- it may sometimes save a very few cycles and a few bytes of storage,
but that's the best it can do.

                                                Greg A. Woods
                                                Planix, Inc.

<>       +1 416 218 0099

Attachment: pgp5XyqcUnHX6.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index