__builtin_constant_p man page on NetBSD

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

__BUILTIN_CONSTANT_P(3)	 BSD Library Functions Manual  __BUILTIN_CONSTANT_P(3)

NAME
     __builtin_constant_p — GNU extension to determine compile time constants

SYNOPSIS
     int
     __builtin_constant_p(value);

DESCRIPTION
     The __builtin_constant_p() is a GNU extension for determining whether a
     value is known to be constant at compile time.  The function is closely
     related to the concept of “constant folding” used by modern optimizing
     compilers.

     If the value is known to be a compile-time constant, a value 1 is
     returned.	If __builtin_constant_p() returns 0, the value is not a com‐
     pile-time constant in the sense that gcc(1) was unable to determine
     whether the value is constant or not.

EXAMPLES
     A typical example of the use of __builtin_constant_p() involves a situa‐
     tion where it may be desirable to fold the computation if it involves a
     constant, but a function call is needed otherwise.	 For instance,
     bswap16(3) is defined in NetBSD as:

	   #define bswap16(x) \
		   (__builtin_constant_p((x)) ? \
		    __byte_swap_u16_constant(x) : __BYTE_SWAP_U16_VARIABLE(x))

SEE ALSO
     gcc(1), __builtin_object_size(3), __builtin_return_address(3)

CAVEATS
     This is a non-standard, compiler-specific extension.

BSD			       December 19, 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