Next: Zero Length,Previous: Hex Floats,Up: C Extensions
As an extension, the GNU C compiler supports fixed-point types asdefined in the N1169 draft of ISO/IEC DTR 18037. Support for fixed-pointtypes in GCC will evolve as the draft technical report changes. Calling conventions for any target might also change. Not all targetssupport fixed-point types.
The fixed-point types areshort _Fract,_Fract,long _Fract,long long _Fract,unsigned short _Fract,unsigned _Fract,unsigned long _Fract,unsigned long long _Fract,_Sat short _Fract,_Sat _Fract,_Sat long _Fract,_Sat long long _Fract,_Sat unsigned short _Fract,_Sat unsigned _Fract,_Sat unsigned long _Fract,_Sat unsigned long long _Fract,short _Accum,_Accum,long _Accum,long long _Accum,unsigned short _Accum,unsigned _Accum,unsigned long _Accum,unsigned long long _Accum,_Sat short _Accum,_Sat _Accum,_Sat long _Accum,_Sat long long _Accum,_Sat unsigned short _Accum,_Sat unsigned _Accum,_Sat unsigned long _Accum,_Sat unsigned long long _Accum. Fixed-point data values contain fractional and optional integral parts. The format of fixed-point data varies and depends on the target machine.
Support for fixed-point types includes prefix and postfix incrementand decrement operators (++,--); unary arithmetic operators(+,-,!); binary arithmetic operators (+,-,*,/); binary shift operators (<<,>>);relational operators (<,<=,>=,>);equality operators (==,!=); assignment operators(+=,-=,*=,/=,<<=,>>=);and conversions to and from integer, floating-point, or fixed-point types.
Use a suffix `hr' or `HR' in a literal constant of typeshort _Fract and_Sat short _Fract,`r' or `R' for_Fract and_Sat _Fract,`lr' or `LR' forlong _Fract and_Sat long _Fract,`llr' or `LLR' forlong long _Fract and_Sat long long _Fract,`uhr' or `UHR' forunsigned short _Fract and_Sat unsigned short _Fract,`ur' or `UR' forunsigned _Fract and_Sat unsigned _Fract,`ulr' or `ULR' forunsigned long _Fract and_Sat unsigned long _Fract,`ullr' or `ULLR' forunsigned long long _Fractand_Sat unsigned long long _Fract,`hk' or `HK' forshort _Accum and_Sat short _Accum,`k' or `K' for_Accum and_Sat _Accum,`lk' or `LK' forlong _Accum and_Sat long _Accum,`llk' or `LLK' forlong long _Accum and_Sat long long _Accum,`uhk' or `UHK' forunsigned short _Accum and_Sat unsigned short _Accum,`uk' or `UK' forunsigned _Accum and_Sat unsigned _Accum,`ulk' or `ULK' forunsigned long _Accum and_Sat unsigned long _Accum,and `ullk' or `ULLK' forunsigned long long _Accumand_Sat unsigned long long _Accum.
GCC support of fixed-point types as specified by the draft technical reportis incomplete:
Fixed-point types are supported by the DWARF2 debug information format.