[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


Avoid Unintentional Errors

If the Possible Errors option is on, the compiler checks for some common typographical mistakes that are legal C syntax but that may have unwanted side effects, such as putting in unintended semicolons or confusing = and ==. The compiler generates a warning if it encounters one of these:

If you intended to create an infinite loop, put white space or a comment between the while statement and the semicolon. For example, these statements do not generate errors or warnings, and ensure that you will win the hearts of everyone using your software when the code is executed.


while (i++) ; // OK: White space separation, no warning
while (i++)     /*: Comment separation, no warning */ ;

The Possible Errors option corresponds to the pragma warn_possunwant, described at "warn_possunwant." To check whether this option is on, use __option (warn_possunwant). See "Checking Options" for information on how to use this directive.


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 17, 2000