You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In issue #1234, there was a complaint about the C output files Reko generates not being directly compileable. A contributing factor is that Reko is rendering internal PrimitiveType instances directly. These are not recognized by C compilers as valid code.
A possible solution is to have Reko emit types defined in <stdint.h>. Implementing it would result in:
PrimitiveType.Int32 being rendered as int32_t in C
PrimitiveType.Int16 rendered as int16_t
PrimitiveType.UInt64 rendered as uint64_t
and so on.
However, there are some types that are not defined in <stdint.h>. There is no equivalent to PrimitiveType.Word32, for instance. Granted, uint32_t could be used to render Word32, but this would result in a surjection of multiple Reko PrimitiveTypes mapping onto the same <stdint.h> types. Perhaps Reko should supply a basictypes.h which contains:
typedefunsigned short intword16_t;
typedefunsigned intword32_t;
typedefunsigned long inword64_t;
typedeffloatfloat32_t;
typedeffloatfloat64_t;
For platforms with 36-bit words, a basictypes32.h should be generated, containing:
typedefintint18_t;
typedeflong intint36_t;
// etc
The text was updated successfully, but these errors were encountered:
In issue #1234, there was a complaint about the C output files Reko generates not being directly compileable. A contributing factor is that Reko is rendering internal
PrimitiveType
instances directly. These are not recognized by C compilers as valid code.A possible solution is to have Reko emit types defined in
<stdint.h>
. Implementing it would result in:PrimitiveType.Int32
being rendered asint32_t
in CPrimitiveType.Int16
rendered asint16_t
PrimitiveType.UInt64
rendered asuint64_t
and so on.
However, there are some types that are not defined in
<stdint.h>
. There is no equivalent toPrimitiveType.Word32
, for instance. Granted,uint32_t
could be used to renderWord32
, but this would result in a surjection of multiple RekoPrimitiveType
s mapping onto the same<stdint.h>
types. Perhaps Reko should supply abasictypes.h
which contains:For platforms with 36-bit words, a
basictypes32.h
should be generated, containing:The text was updated successfully, but these errors were encountered: