Re: regarding type promotion

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

 



On Tue, 2008-08-19 at 10:30 +0530, Sivaprasad.pv wrote:

> Is there any way to specify in gcc to perform implicit type promotion 
> first and then perform operation on it (without explicit type casting).

I spent over three decades reading other people's code -- both in
industry and teaching. I always encouraged my students to use explicit
type casting, even when not needed, for it's self-documenting value.

Another rule I gave them is "multiplication and division have higher
precedence than addition and subtraction; use parentheses in all other
cases."

Both "rules of thumb" help the reader to see your intent and minimize
your chances of making a mistake.

Bob



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux