👤
Home Man
Search
Today's Posts
Register

Linux & Unix Commands - Search Man Pages
Man Page or Keyword Search:
Select Section of Man Page:
Select Man Page Repository:

NetBSD 6.1.5 - man page for __unvolatile (netbsd section 3)

__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 oper-
     ating with pointers declared with the const type qualifier in a context without such quali-
     fier.  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


All times are GMT -4. The time now is 05:19 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password