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: Mini-patch for cccp.c



  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


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