The following table lists the lint-style comments available with the SGI C compiler, along with a short description. See the lint(1) reference page for more details.
The preprocessor automatically strips out comments. This prevents the lint-style comments from being seen by the rest of the compiler and therefore these comments will not work from within macros.
To work around this, turn off the offending message locally by using set woff pragmas, as in this example:
#define MY_DEFS() \ \ int X; \ int Y; \ int Z; void func2(void) { #pragma set woff 1174 MY_DEFS(); #pragma reset woff 1174 X = 2; Z = 4; junk (X,X,Z); } |
In this example, 1174 refers only to the message for unreferenced variables. The other link-style suppression will need different message numbers.
Table B-1. lint-style Comments
Comment | Short Description |
---|---|
Applies lint-style check to the first (n-1) arguments as usual. The nth argument is interpreted as a printf format string that is used to check the remaining arguments. | |
Applies lint-style check to the first (n-1) arguments as usual. The nth argument is interpreted as a scanf format string that is used to check the remaining arguments. | |
Applies lint-style check to only the first n arguments for usage; a missing n is taken to be 0 (this option acts like the -v option for the next function). | |
Suppresses the usual checking for variable numbers of arguments in the following function declaration. The data types of the first n arguments are checked; a missing n is taken to be 0. The use of the ellipsis terminator (...) in the definition is suggested in new or updated code. | |
Stops comments about unreachable code when placed at appropriate points. (This comment is typically placed just after calls to functions like exit). | |
Tells the compiler that the variable defined after comment is referenced. |