Mini-patch for cccp.c
Jeffrey A Law
law@cygnus.com
Mon Oct 6 16:49:00 GMT 1997
In message < 199710011532.QAA30355@mvmap66.ciw.uni-karlsruhe.de >you write:
> If you look at finclude() in cccp.c, you'll find this code:
>
> static void
> finclude (f, inc, op, system_header_p, dirptr)
> int f;
> struct include_file *inc;
> FILE_BUF *op;
> int system_header_p;
>
> [...]
>
> FILE_BUF *fp;
>
> fp->system_header_p = system_header_p;
>
> Now, system_header_p has to be an int beause there might be a K&R
> compiler which, without prototypes, promotes a char to an int.
>
> fp->system_header_p is a char. Does this add to the clarity of the
> code?
Marginally, if at all.
> In another place, system_header_p is used not as a boolean, but as a
> small int, i.e. in do_line():
That's still OK. Using a char as a small int is fine as long as the code
doesn't depend on signedness.
jeff
More information about the Gcc
mailing list