Subject: Re: ansi.h merger
To: Todd Vierling <tv@wasabisystems.com>
From: Christos Zoulas <christos@zoulas.com>
List: tech-ports
Date: 07/28/2001 12:19:29
On Jul 28, 12:15pm, tv@wasabisystems.com (Todd Vierling) wrote:
-- Subject: Re: ansi.h merger

| Huh?  Unless you have a specific counterexample, all cases where the
| compiler is warning about type conversion portability problems are perfectly
| correct in their assertions.

It is a PITA to change int's in structures to size_t's, or cast every use
of them.

| : It is a problem when you have an int that you are passing in a size_t
| : parameter argument. consider:
| :
| :     strncpy(foo, bar, 13);
| :
| : Well, is that 13U or 13UL? Or should I need to cast it to (size_t)13?
| 
| C99 type conversion rules allow this case to be promoted without a warning,
| because the default case of nonnegative "int" constant can be promoted to
| "unsigned int" and then "unsigned long" automatically.

I know, but lint bitches.

| Not all can be made MI, mind you.  I found clock_t as one such type already,
| but I haven't scanned through everything.

most of them can though.

christos