diff options
Diffstat (limited to 'contrib/gcc')
-rw-r--r-- | contrib/gcc/ChangeLog.gcc43 | 6 | ||||
-rw-r--r-- | contrib/gcc/doc/extend.texi | 23 |
2 files changed, 29 insertions, 0 deletions
diff --git a/contrib/gcc/ChangeLog.gcc43 b/contrib/gcc/ChangeLog.gcc43 index 3f893ac..05f0107 100644 --- a/contrib/gcc/ChangeLog.gcc43 +++ b/contrib/gcc/ChangeLog.gcc43 @@ -1,3 +1,9 @@ +2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de> (r23479) + + PR preprocessor/23479 + * doc/extend.texi: Document the 0b-prefixed binary integer + constant extension. + 2007-05-01 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com> (r124341) * doc/invoke.texi: Fix typo, 'AMD Family 10h core' instead of diff --git a/contrib/gcc/doc/extend.texi b/contrib/gcc/doc/extend.texi index d7a1494..d27af10 100644 --- a/contrib/gcc/doc/extend.texi +++ b/contrib/gcc/doc/extend.texi @@ -81,6 +81,7 @@ extensions, accepted by GCC in C89 mode and in C++. * Pragmas:: Pragmas accepted by GCC. * Unnamed Fields:: Unnamed struct/union fields within structs/unions. * Thread-Local:: Per-thread variables. +* Binary constants:: Binary constants using the @samp{0b} prefix. @end menu @node Statement Exprs @@ -10424,6 +10425,28 @@ Non-@code{static} members shall not be @code{__thread}. @end quotation @end itemize +@node Binary constants +@section Binary constants using the @samp{0b} prefix +@cindex Binary constants using the @samp{0b} prefix + +Integer constants can be written as binary constants, consisting of a +sequence of @samp{0} and @samp{1} digits, prefixed by @samp{0b} or +@samp{0B}. This is particularly useful in environments that operate a +lot on the bit-level (like microcontrollers). + +The following statements are identical: + +@smallexample +i = 42; +i = 0x2a; +i = 052; +i = 0b101010; +@end smallexample + +The type of these constants follows the same rules as for octal or +hexadecimal integer constants, so suffixes like @samp{L} or @samp{UL} +can be applied. + @node C++ Extensions @chapter Extensions to the C++ Language @cindex extensions, C++ language |