New Errors and Warnings

The C 7.0 compiler catches more problems and therefore generates more errors and warnings than the C 6.0 compiler. Warning levels are new adjustable, and you can also specify that warnings display only once or not at all. See “Pragma Directives” for information on pragma warning.

Unrecognized escape sequences now generate a level 1 warning instead of level 4 the backslash is an escape sequence in strings and some operating systems use the backslash as a path separator.

The compiler generates a level 1 warning if a header file uses #pragma pack to change the packing size for a structure and does not reset the packing size to the original level.

The following changes to errors and warnings were made in order to conform with the ANSI standard:

A hex escape sequence used as a char constant generates an error if it exceeds the range of type char (or the range of wide characters for type whar_t).

Overflow on constant expressions now generate warnings.

Declarations that do not declare at least one declarator, tag, or enum member now generate a warning.

Translation units that do not contain at least one external declaration generate warnings.

Attempting to take the address of a register array, either explicitly or implicitly, now generates an error.

Function parameters declared with the auto attribute generate an error.

Block-scope function declarations with a storage-class specifier other than extern generate errors.

When compiling with /Za, the main function must conform to either of the following or the compiler generates an error:

int main( void )

int main( int argc, char *argv[] )

Escaped newline characters in single-line comments (comments preceded by //) now generate a level 1 warning.