Unix and Linux Discussions Tagged with compile |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
25,923 |
Shell Programming and Scripting |
|
|
|
1 |
13,432 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
7,047 |
Shell Programming and Scripting |
|
|
|
1 |
6,519 |
Programming |
|
|
|
1 |
10,489 |
UNIX for Advanced & Expert Users |
|
|
|
9 |
12,739 |
Solaris |
|
|
|
14 |
6,461 |
Programming |
|
|
|
1 |
6,466 |
UNIX for Beginners Questions & Answers |
|
|
|
11 |
7,270 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
2,002 |
Programming |
|
|
|
1 |
35,739 |
Shell Programming and Scripting |
|
|
|
0 |
7,496 |
AIX |
|
|
|
4 |
10,120 |
Slackware |
|
|
|
10 |
7,973 |
Solaris |
|
|
|
1 |
7,219 |
Red Hat |
|
|
|
1 |
6,372 |
OS X (Apple) |
|
|
|
0 |
12,613 |
Solaris |
|
|
|
17 |
31,253 |
Solaris |
|
|
|
0 |
6,376 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
5,321 |
Solaris |
|
|
|
1 |
5,640 |
Linux |
|
|
|
0 |
3,157 |
Ubuntu |
|
|
|
2 |
3,495 |
Programming |
|
|
|
2 |
5,125 |
UNIX for Advanced & Expert Users |
|
|
|
4 |
5,482 |
OS X (Apple) |
|
|
|
17 |
13,715 |
Solaris |
|
|
|
5 |
49,833 |
Shell Programming and Scripting |
|
|
|
4 |
6,202 |
Programming |
|
|
|
5 |
15,413 |
Ubuntu |
|
|
|
1 |
3,461 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
5,083 |
Solaris |
|
|
|
1 |
6,789 |
UNIX and Linux Applications |
|
|
|
1 |
9,713 |
Shell Programming and Scripting |
|
|
|
1 |
5,724 |
Linux |
|
|
|
0 |
7,133 |
Programming |
|
|
|
0 |
4,110 |
Programming |
|
|
|
5 |
8,489 |
Programming |
|
|
|
2 |
5,222 |
Shell Programming and Scripting |
|
|
|
2 |
7,400 |
AIX |
|
|
|
0 |
1,309 |
Software Releases - RSS News |
__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 compile-
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 situation 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