5.6 Compiler data flow warnings

The compiler performs data flow analysis as part of its optimization process. This information can help identify potential problems in your code, for example, issuing 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 C4017W: 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 C4017W 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=C4017 and then use any appropriate third-party analysis tool, for example Lint.
Related concepts
5.2 Options that change the severity of compiler diagnostic messages
5.3 Controlling compiler diagnostic messages with pragmas
5.4 Prefix letters in compiler diagnostic messages
5.5 Compiler exit status codes and termination messages
Related reference
5.1 Severity of compiler diagnostic messages
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.