C language FAQ

I'm having trouble declaring structs as types. The compiler refuses typedefs of long structs

There is a legacy limit in the compiler: typedefs cannot be longer than 256 characters. In most cases, this limit is never reached.

There is a completely effective workaround: using the tag facility in struct, union, and enum declarations. The tag serves as a kind of typedef: declaring a struct, union, and enum with a tag (but without a variable name) allows the tag to be used in subsequent declarations, including typedefs.

For instance:

struct tag_mystruct { int one; int two; int three; };

typedef struct tag_mystruct type_mystruct;

will allow a structure definition (or union or enum) of longer than 256 characters.


What is "IEEE-754"?

A standard for representing floating point numbers within words of various sizes. It's an IEEE standard.

Applications of floating point math are rare in embedded systems. It's usually much easier to leave sampled values in their original integer or unsigned integer format as long as possible, even if you need to refactor your calculations.

Also, fixed point types are usually a good substitute.