From: Dan Sugalski Date: 2003-10-21T03:44:22+09:00 Subject: Re: OT: Strict typing on large projects On Tue, 21 Oct 2003, Paul Brannan wrote: > On Sat, Oct 18, 2003 at 06:04:04AM +0900, Dan Sugalski wrote: > > C is a weakly typed language because, with casts, you can make the > > compiler treat any memory location as any type you'd care to. > > You don't even need casts: > printf("%d\n", y); /* implementation-specific behavior here, but Function calls are a form of cast, albeit a hidden one, and the trick you're using here isn't actually valid on all processors. You can do this with any function as long as the body and use of that function differs in type. It will rarely, if ever, work right on PPCs or Alphas when 'casting' between an int type and a float type, for example, just in case you're considering using it. (Believe me, there are times I'd have liked to be able to do so...) That's beside the point, though. Dan