warn_possunwant

Controls the recognition of possible unintentional logical errors.

Syntax
#pragma warn_possunwant on | off | reset
Remarks

If you enable this pragma, the compiler checks for common, unintended logical errors:

if (a=b) f(); /* WARNING: a=b is an assignment. */

if ((a=b)!=0) f(); /* OK: (a=b)!=0 is a comparison. */

if (a==b) f(); /* OK: (a==b) is a comparison. */
i = sockcount();
while (--i);  /* WARNING: empty loop. */
    matchsock(i);

If you intended to create an infinite loop, put white space or a comment between the while statement and the semicolon. The statements in the listing below, suppress the above error or warning messages.

Listing 4. Intentional empty statements
while (i++) ; /* OK: White space separation. */
while (i++) /* OK: Comment separation */ ;

By default, this pragma is off .

Related information
extended_errorcheck
maxerrorcount
message
showmessagenumber
show_error_filestack
suppress_warnings
sym
unused
warning
warning_errors
warn_any_ptr_int_conv
warn_emptydecl
warn_extracomma
warn_filenamecaps
warn_filenamecaps_system
warn_hiddenlocals
warn_illpragma
warn_illtokenpasting
warn_illunionmembers
warn_impl_f2i_conv
warn_impl_i2f_conv
warn_impl_s2u_conv
warn_implicitconv
warn_largeargs
warn_missingreturn
warn_no_side_effect
warn_padding
warn_pch_portability
warn_ptr_int_conv
warn_resultnotused
warn_undefmacro
warn_uninitializedvar
warn_unusedarg
warn_unusedvar