You copied the Doc URL to your clipboard.

Compiler data flow warnings

The compiler performs data flow analysis as part of its optimization process. This information can be used to identify potential problems in your code, for example, to issue warnings about the use of uninitialized variables.

The data flow analysis can only warn about local variables that are held in processor registers, not global variables held in memory or variables or structures that are placed on the stack.

Be aware that:

  • Data flow warnings are issued by default. In RealView Compiler Tools (RVCT) v2.0 and earlier, data flow warnings are issued only if the -fa option is specified.

  • Data flow analysis is disabled at -O0, even if the -fa option is specified.

The results of this analysis vary with the level of optimization used. This means that higher optimization levels might produce a number of warnings that do not appear at lower levels. For example, the following source code results in the compiler generating the warning C3017W: i may be used before being set, at -O2:

int f(void)
    int i;
    return i++;

The data flow analysis cannot reliably identify faulty code and any C3017W warnings issued by the compiler are intended only as an indication of possible problems. For a full analysis of your code, suppress this warning with --diag_suppress=C3017 and then use any appropriate third-party analysis tool, for example Lint.

See also