At Tue, 02 Mar 2010 07:57:42 +1100, matthew green <mrg%eterna.com.au@localhost> wrote: 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. <woods%planix.com@localhost> +1 416 218 0099 http://www.planix.com/
Attachment:
pgp5XyqcUnHX6.pgp
Description: PGP signature