T
Tomás Ó hÉilidhe
There are a few guarantees I exploit in the C Standard. For instance,
I might write
(unsigned)-1
to get the maximum value for an unsigned integer.
Also, I might rely on things such as:
memset(data,-1,sizeof data)
to set all bits in a chunk of memory to 1.
I'm using an embedded systems compiler now though and I'm hesitant to
trust it with things like this. I've already come across the following
quirks:
1) You can't define a variable as const unless it can be put in the
chip's ROM.
2) There's no stack used by default; you must define a function as
"reentrant" if you want a stack.
To the people here who have experience with embedded systems C
compilers, how do you feel about trusting its C compliance? Some
issues I'd be concerned about are:
1) int being at least 16-Bit
2) long being at least 32-Bit
3) Compliant conversion between signed and unsigned types
I'm using the PIC C compiler to program the PIC16F684 chip.
I might write
(unsigned)-1
to get the maximum value for an unsigned integer.
Also, I might rely on things such as:
memset(data,-1,sizeof data)
to set all bits in a chunk of memory to 1.
I'm using an embedded systems compiler now though and I'm hesitant to
trust it with things like this. I've already come across the following
quirks:
1) You can't define a variable as const unless it can be put in the
chip's ROM.
2) There's no stack used by default; you must define a function as
"reentrant" if you want a stack.
To the people here who have experience with embedded systems C
compilers, how do you feel about trusting its C compliance? Some
issues I'd be concerned about are:
1) int being at least 16-Bit
2) long being at least 32-Bit
3) Compliant conversion between signed and unsigned types
I'm using the PIC C compiler to program the PIC16F684 chip.