Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Aug 1996 20:01:33 +0200 (SAT)
From:      Robert Nordier <rnordier@iafrica.com>
To:        hoek@freenet.hamilton.on.ca (Tim Vanderhoek)
Cc:        questions@freebsd.org
Subject:   Re: Programming Question
Message-ID:  <199608261801.UAA00508@eac.iafrica.com>
In-Reply-To: <Pine.SOL.3.91.960826101246.27905B-100000@james.freenet.hamilton.on.ca> from "Tim Vanderhoek" at Aug 26, 96 10:19:39 am

next in thread | previous in thread | raw e-mail | index | archive | help
Tim Vanderhoek wrote:
> 
> On Mon, 26 Aug 1996, Robert Nordier wrote:
> 
> > Note that 'typedef' doesn't create types, just synonyms for existing
> > types.  So the assignment <AT> = <int> doesn't involve a type
> > conflict in any sense.
> 
> If I set a typedef, it's because I want all variables in a given group to 
> be that type.  I might later decide to change that (ie. int isn't quite 
> large enough when someone decides to check a doc with 66000 words; let's 
> try long int).  All of a sudden, a bunch of errors will spew all over the 
> place.  I'd prefer to know about them now, rather than later.  The 
> exception, of course, is when passing a variable of type <AT> (where <AT> 
> == <int>) to a library function expecting an int.  In all other places a 
> warning would be nice... :(

It's a valid concern.  It probably just goes too much against the
deliberately weakly typed philosophy of C to require this kind of
help from compilers.

Could certainly be useful as a lint option, though.

--
Robert Nordier



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608261801.UAA00508>