Thanks. I just re-examined the code and did not find this kind of mistakes. I can post the code if someone is interested to take a look. (I will have to delete the comments and rename functions and variables in order to conceal the purpose of the application.) ----- Original Message ----- From: "Scott Dattalo" To: Sent: Wednesday, August 13, 2003 5:38 AM Subject: Re: [PIC]: Seek C Complier Recommendations > On Wed, 13 Aug 2003, Tony Pan wrote: > > > >> It could still be bad code in the first place, which happened to work > > with the original compiler. > > > > What kind of bad code could that be? > > If the programmer makes an incorrect assumption about the default > signedness of char's, then it's possible that code will "work" on one > compiler but not another. > > e.g. > > char c; > > for(c = 0; c<200; c++) > ... > > If char is unsigned, then this loop make 200 iterations. If c is signed, > then a) the compiler should issue a warning (because 200 exceeds 127, the > maximum value of an 8-bit signed number) and b) depending on how the > constant is treated make 0 iterations (because '200' is actually a > negative number) or infinite iterations because 'c' can never reach 200. > > The most portable way to express char's is by explicitly stating their > signedness. (BTW, Bob A. pointed the char signedness issue out to me a > long time ago). > > Scott > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body