ayttm-devel
[Top][All Lists]
Advanced

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

Re: [Ayttm-devel] Re: [Ayttm-users] forgot one point


From: Philip S Tellis
Subject: Re: [Ayttm-devel] Re: [Ayttm-users] forgot one point
Date: Wed, 15 Jan 2003 13:34:51 +0530 (IST)

On Wed, 15 Jan 2003, Colin Leroy wrote:

> Thought again about this. I guess the best would be to avoid typecasting
> during development, so we actually see the compiler warnings, but add the
> explicit casts later, once the code is known good, in order to

well, a compiler warning suggests one of two things - either we need to 
relook at that code because we really do have a type conversion bug, or 
we need to typecast.  In my experience, a necessary typecast rarely 
occurs.

toolkits like Gtk+ provide macros for safe type conversion - ie, they 
actually check if the type can be converted before doing the typecast.  
We should use these wherever possible.

basic data types seldom need typecasts.  char to int works well, int to 
char is almost always a bug.  signed to unsigned and non-const to const 
are the only places I can think of where an explicit typecast may be 
required.

Philip

-- 
Let us live!!!
Let us love!!!
Let us share the deepest secrets of our souls!!!

You first.







reply via email to

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