summaryrefslogtreecommitdiffstats
path: root/gcc/extend.texi
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-12-01 21:05:17 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-12-01 21:05:17 +0000
commit75bd5adae1072ec96f2b05f35147891f977ab2b2 (patch)
tree8180a32dab64f00b8c46fedcdc5e7b9928102158 /gcc/extend.texi
parentc50a498ccf40a4f355b138f6e51e500095895ba0 (diff)
downloadppe42-gcc-75bd5adae1072ec96f2b05f35147891f977ab2b2.tar.gz
ppe42-gcc-75bd5adae1072ec96f2b05f35147891f977ab2b2.zip
* c-common.c (declare_function_name): Declare predefinied variable
`__func__'. * c-decl.c (flag_isoc9x): Set to 1 by default. (c_decode_option): Handle -std= option. Remove -flang-isoc9x. (grokdeclarator): Always emit warning about implicit int for ISO C 9x. * c-parse.in: Allow constructors in ISO C 9x. Rewrite designator list handling. Allow [*] parameters. Don't warn about comma at end of enum definition for ISO C 9x. * cccp.c (c9x): New variable. (rest_extension): New variable. (print_help): Document new -std= option. (main): Recognize -std= option. Set c9x appropriately. (create_definition): Recognize ISO C 9x vararg macros. * gcc.c (default_compilers): Adjust specs for -std options. (option_map): Add --std. (display_help): Document -std. * toplev.c (documented_lang_options): Add -std and remove -flang-isoc9x. * c-lex.c (yylex): Recognize hex FP constants and call REAL_VALUE_ATOF or REAL_VALUE_HTOF based on base of the constants. * fold-const.c (real_hex_to_f): New function. Replacement function for hex FP conversion if REAL_ARITHMETIC is not defined. * real.c (asctoeg): Add handling of hex FP constants. * real.h: Define REAL_VALUE_HTOF if necessary using ereal_atof or real_hex_to_f. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/extend.texi')
-rw-r--r--gcc/extend.texi18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/extend.texi b/gcc/extend.texi
index dac40359303..c1cd7889db5 100644
--- a/gcc/extend.texi
+++ b/gcc/extend.texi
@@ -33,6 +33,7 @@ C++ Language}, for extensions that apply @emph{only} to C++.
* Conditionals:: Omitting the middle operand of a @samp{?:} expression.
* Long Long:: Double-word integers---@code{long long int}.
* Complex:: Data types for complex numbers.
+* Hex Floats:: Hexadecimal floating-point constants.
* Zero Length:: Zero-length arrays.
* Variable Length:: Arrays whose length is computed at run time.
* Macro Varargs:: Macros with variable number of arguments.
@@ -78,6 +79,7 @@ C++ Language}, for extensions that apply @emph{only} to C++.
* Conditionals:: Omitting the middle operand of a @samp{?:} expression.
* Long Long:: Double-word integers---@code{long long int}.
* Complex:: Data types for complex numbers.
+* Hex Floats:: Hexadecimal floating-point constants.
* Zero Length:: Zero-length arrays.
* Variable Length:: Arrays whose length is computed at run time.
* Macro Varargs:: Macros with variable number of arguments.
@@ -791,6 +793,22 @@ examine and set these two fictitious variables with your debugger.
A future version of GDB will know how to recognize such pairs and treat
them as a single variable with a complex type.
+@node Hex Floats
+GNU CC recognizes floating-point numbers written not only in the usual
+decimal notation, such as @code{1.55e1}, but also numbers such as
+@code{0x1.fp3} written in hexadecimal format. In that format the
+@code{0x} hex introducer and the @code{p} or @code{P} exponent field are
+mandatory. The exponent is a decimal number that indicates the power of
+2 by which the significand part will be multiplied. Thus @code{0x1.f} is
+1 15/16, @code{p3} multiplies it by 8, and the value of @code{0x1.fp3}
+is the same as @code{1.55e1}.
+
+Unlike for floating-point numbers in the decimal notation the exponent
+is always required in the hexadecimal notation. Otherwise the compiler
+would not be able to resolve the ambiguity of, e.g., @code{0x1.f}. This
+could mean @code{1.0f} or @code{1.9375} since @code{f} is also the
+extension for floating-point constants of type @code{float}.
+
@node Zero Length
@section Arrays of Length Zero
@cindex arrays of length zero
OpenPOWER on IntegriCloud