[Simh] Warning when compiling with Intel C

Nelson H. F. Beebe beebe at math.utah.edu
Mon Jul 16 20:30:51 EDT 2007


>> else if ((c = '%') && (val > 0) && (val < 100))

If this is not a test for c being a percent sign, then it is better
to code it as a comma expression:

	else if ((c = '%', c) && ... )

That way, it is clear to the reader, and the compiler, that the
value tested is the character itself, not the result of an equality
test.

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe at math.utah.edu  -
- 155 S 1400 E RM 233                       beebe at acm.org  beebe at computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------



More information about the Simh mailing list