This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: typed cast's


On Sun, Sep 09, 2001 at 12:41:39AM +0200, Frank Klemm wrote:
> This has nothing to do with optimization.
> 
> This has something to do with the parser.

In the future, would you mind starting a new thread if you want to
discuss a completely different subject?

> Typecasting is dangerous. But sometimes you need typecasting.
> Often you want to cast type A to type B.
> C has only the possibity to cast any type to type B.
[etc]

I believe it is the general feeling of the group that we already have
too many extensions, and we are not interested in adding new ones.

I'd like to point out that most of the casts in code I write are
because I don't _know_ the type of the item being cast from.  The
usual example is something like

printf("%lu\n", (unsigned long)value);

where the type of VALUE is e.g. "time_t", which does not correspond to
a printf letter, and assuming it's any specific one is wrong.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]