What are the C standard fixed width floating point types and where are they defined?
From MISRA-C:2004, Rule 6.3:
typedefs
that indicate size and signedness should be used in place of the basic numerical types.
The MISRA-C:2004, Rule 6.3 quotes that ISO (POSIX) typedefs are:
typedef char char_t;
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef signed long int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long uint64_t;
typedef float float32_t;
typedef double float64_t;
typedef long double float128_t;
At my company we are using C-99.
IAR Electronic Workbench, version 8.4
We are at MISRA-C:2004 because they voted not to upgrade MISRA, which would require create a validation test protocol and running the protocol.
Platform is ARM Cortex M running MicroCOS operating system.
Here are the detailed questions:
- What are the typedefs for the fixed width floating point types?
- What include file are they inside (or are they defined as default by the compiler)?
cppreference.com
did not show fixed width types when searched for "float32_t". – Ceasefirefloat64_t
anywhere in the .h files in a macOS SDK, and it is supposed to be POSIX-compliant. Why did you write “ISO (POSIX)”? ISO is an organization; POSIX is a standard. Being compliant with one thing ISO publishes is not the same as being compliant with POSIX. – Caughtstdint.h
. I didn't find any keywords that showed the width of the floating points. – Ceasefire