This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DS-5 data type definitions

Hi,

I'm looking for a list of definitions of each of the data types which are appended to the end of values for ARM DS-5 v5.20.1. I have looked and searched the ARM DS-5 v5.20.1 documentation to no avail.

For example in 0xFFFFFFFFU how does the compiler interpret 'U'? Does it just indicate that the value is unsigned, or does it also specify size such as a word? Other appended characters include f for float, d for double, etc.

Thanks in advance,

Ryan

  • Hi,

    These are part of the C standard, rather than being specific to the DS-5 toolchains. See this webpage for integer literals, and this webpage for floating point literals.

    So for integers:

    • (No Suffix) = Signed Integer
    • U = Unsigned Integer
      It does not change the size, i.e. an int just becomes an unsigned int, a long just becomes an unsigned long, etc
    • L = Long Integer
      This promotes the size of the integer (int becomes long int, unsigned int becomes long unsigned int, etc)

    And for floats:

    • (No Suffix) = Double-precision float
    • F = Single-precision float
      This prevents the automatic promotion to double-precision
    • L = Long double-precision float

    Note that the integer suffixes can be combined, so for example 1000UL would make the constant an unsigned long integer, 5000LL would make the constant a long long signed integer, and 2500ULL would be an unsigned long long integer.

    I hope that helps,

    Ash.