Is there a way to get the gcc preprocessor to replace a type with what defined by the typedef, i.e.
something like this:
typedef unsigned char Uint8
int main(void)
{
Uint8 a = 1;
Uint8 b = 2;
Uint8 c;
c = a + b;
return 0;
}
Would get preprocessed into something like this:
int main(void)
{
unsigned char a = 1;
unsigned char b = 2;
unsigned char c;
c = a + b;
return 0;
}
No, there isn’t, because type aliasing is part of compilation stage and not a pre-processing stage. Therefore pre-processor cannot know anything about types by design and cannot perform any operations on those types. Also, you forgot to put
;at the end of typedef statement.