__UNCONST man page on NetBSD

Man page or keyword search:  
man Server   9087 pages
apropos Keyword Search (all sections)
Output format
NetBSD logo
[printable version]

__UNCONST(3)		 BSD Library Functions Manual		  __UNCONST(3)

NAME
     __UNCONST — compile time cast-away macro

SYNOPSIS
     #include <sys/cdefs.h>

     void
     __UNCONST(x);

     void
     __UNVOLATILE(x);

DESCRIPTION
     The __UNCONST() macro can be used to omit warnings produced by certain
     compilers when operating with pointers declared with the const type qual‐
     ifier in a context without such qualifier.	 Examples include passing a
     pointer declared with the const qualifier to a function without such
     qualifier, and variable assignment from a const pointer to a non-const
     pointer.  In the same vein, the __UNVOLATILE() macro can be used to
     exclude warnings related to the volatile type qualifier.

IMPLEMENTATION NOTES
     These macros are implemented by explicitly using unsigned long instead of
     intptr_t, a signed type guaranteed to hold a pointer.

SEE ALSO
     cc(1), cdefs(3)

CAVEATS
     As both macros may hide valid errors, their usage is not recommended
     unless there is a well-thought reason for a cast.	A typical use case for
     __UNCONST() involve an API that does not follow the so-called ``const
     correctness'' even if it would be appropriate.  Valid use cases of
     __UNVOLATILE() include passing a volatile pointer to memset(3).

BSD			       December 16, 2010			   BSD
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server NetBSD

List of man pages available for NetBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net