Topic : Reference manual

Forum : ARM

Original Post
Post Information Post
June 22, 2011 - 9:38pm
Guest

Hello,
I'm looking for a reference manual for the compiler and librairies.
All I can find is what is here
http://www.gnuarm.com/pdf/libc.pdf

For example, I don't have type definitions such as the length of int, long, short and so on. I don't know how to declare a single bit variable. I use some things known from other compilers, but, I'm sure there are many things more dedicated to ARM.
I don't have pragmas definition and I can't find everykind of links for that on this forums (using serach function). I must have missed something, but I don't know where to look for. There are also a lot of librairies, but I just can find docs for libc.

Replies
Post Information Post
+1
0
-1
June 23, 2011 - 8:54am
Raisonance Support Team

Hi,

In the "documentation" windows of Ride7 you will have plenty of inforamtion, including the gcc manual.
Also you can use the standard "limits.h" file, which will give you some information about the basic types size.

Notes:
Only "int" is questionable. The C standard mandates that:
- A short is 16-bit.
- A long is 32-bit.
The "char" type has no known sign. For safety it is always better to use "signed char" or "unsigned char" instead of plain "char".

Best Regards,

+1
0
-1
June 24, 2011 - 7:43pm
Guest

The gcc manual just help on using gcc and not having language keywords.
Can you tell me how to declare a one bit variable (boolean)?
I have a typedef enum{true=1,false=0} boolean
Does this create a one bit variable?

+1
0
-1
June 27, 2011 - 9:16am
Raisonance Support Team

Hi,

Your declaration is just fine, if you really want to handle some bit-sized entities.
However, recall that the C language is pretty much centered about "O (zero)" and "not-zero" values, so it will always be better to handle values as 0 or not zero.

I.e., instead of "if (myvalue == true)", consider writing "if (!myvalue)". The readability is slightly decreased, but at least the generated code will be optimal.
This basically means that TRUE can be used for assignement only, but in comparisons only the FALSE value should be used.

Best Regards,