Preprocessor Directives 365
11.10 INLINE DIRECTIVE
Reports the compiler that the source code has in line asm statements. It is important to know
previously that the source code contains assembly code.
11.11 THE #pragxna SAVEREGS
Guarantees that a huge function will not modify the value of any of the registers when it is entered.
Place this directive immediately preceding the function definition.
11.12 THE #pragma DIRECTIVE
The A N S I-C and T U R B O -C provide pragma directives. These #pragma directives are defined
with # (hash) and these are the preprocessor directives. These directives deal with formatting
source listing and placing components in the object file generated by the compiler. It sets /resets
certain warning and errors during compilation of C program. Tables 11.1,11.2,11.3 and 11.4 describe
the different pragma names with error messages.
Syntax
# pragma warn + xxx
# pragma warn -xxx
Where the first statement turns on the warning message and the second statement sets off the warning
message.
Table 11.1 ANSI Violations and #pragma
#pragma name Warning On
Warning off
Hexadecimal or octal constant too large +big
-b ig
Redefinition not identical
+dup
- dup
Both return and return of a value used
+ret
-ret
Not part of structure
+str
-str
Undefined structure
+stu -stu
Suspicious pointer conversion
+S US -sus
Void functions cannot return a value
+voi
-voi
Zero length structure
+zst
-zst
Table 11.2 Common Errors and #pragma
#pragmaname
Warning On Warning off
Assigned a value but never used
+aus -aus
Possible use before definition
+def -def
Code has no effect
+eff -eff
Parameter never used
+par
-par
Possibly incorrect assignment
+pia -pia
Unreachable code
+rch
-rch
Function should return a value
+rvl
-rvl
Ambiguous operators need parentheses
+anb
-amb