Compiler -w Flags
-w
compiler flags are warning flags.
All -w
compiler flags are provided in the form:
-Wwarning-name
-
To enable the flag, use:
-W*warning-name*
Example:
>cobc -Wall sample.cbl
-
To disable the flag, use:
-Wno-*warning-name*
Example:
>cobc -Wno-all sample.cbl
Warnings are evaluated in the command line order. For example, use the command: >cobc -Wall -Wno-archaic
to enable all warnings but the archaic features.
Note
cobc -w
when used with no warning flag has the effect of disabling all warnings.
Example: >cobc -w sample.cbl
The Warning Compiler flags are listed in the table below:
Compiler Flag | Description |
---|---|
-w* |
Disables all warnings. |
-Wall |
Enables all warnings. |
-Warchaic |
Warns if archaic features are used. |
-Wbdb |
Warns about bdb license. (default). |
-Wcall-params |
Warns if non 01/77 items are used for CALL parameters (NOT set with Wall). |
-Wconstant |
Warns if inconsistent constant is used. |
-Wimplicit-define |
Warns of implicitly defined data items. |
-Winformation |
Warns information about 'not recommended' code. -Winformation is applied by default. |
-Wlinkage |
Warns of dangling LINKAGE items. (NOT set with -Wall ). |
-Wobsolete |
Warns if obsolete features are used. |
-Wparentheses |
Warns of lack of parentheses around AND within OR . |
-Wredefinition |
Warns if incompatible redefinition of data items are used. -Wredefinition is defined by default. |
v-Wstrict-typing |
Warns of type mismatch strictly. |
-Wsuggestion |
Warns suggestions about 'not recommended' code. -Wsuggestion is applied by default. |
-Wterminator |
Warns of lack of scope terminator, such as END-XXX . (NOT set with -Wall ). |
-Wtruncate |
Warns of possible field truncations. -Wtruncate is applied by default. |
-Wunreachable |
Warns of unreachable statements. |