5.14.3.11.2 The Warning Error/Warning Pragma
It is possible to change the types of some messages.
A message type can only be changed by using the warning
pragma and this only affects messages generated by the parser or code generator. The
position of the pragma is only significant for the parser; i.e., a parser message number
can have its type changed for one section of the code to target specific instances of the
message. Specific instances of a message produced by the code generator cannot be
individually controlled and the pragma will remain in force during compilation of the
entire program.
The following example shows the warning produced in the previous example
being converted to an error for the instance in the function main()
.
int main(void) {
unsigned char c;
#pragma warning error 359
readp(&i);
}
Building this code would result in an error, not the usual warning.