avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Stronger type checking that usual?


From: Ernst Stippl
Subject: [avr-gcc-list] Stronger type checking that usual?
Date: Sun, 4 Sep 2005 21:29:57 +0200

Hi!

If I define:

typedef enum {FALSE=0, TRUE} Boolean; 
typedef int my_int;

Boolean Boolean_flag; 
my_int a,b;
int c;

in a source to be compiled with avr-gcc, then the assignments

Boolean_flag = a;
c = b;
a = 0;
b = a;

are accepted by the compiler and compiled OK.

Is there a way to instruct the compiler to flag the 1st and 2nd assignment
as "wrong" because they mix types?
I want to make sure that assignments or arithmethic with variables of
self-declared types cannot be mixed. 
I know this is not standard in C, but I am looking for ways to "help" me
avoiding the wrong usage of variables by introducing self-declared types (or
any other vehicle available).

Thanks & Regards
Ernst







reply via email to

[Prev in Thread] Current Thread [Next in Thread]