Inspect Manual
Using Inspect With C++
Inspect Manual—429164-006
9-4
Examples
Specifying code locations by label
You can use a C++ label as the code reference in a code location. However,
because Inspect also accepts scope units as code references, a conflict arises if a
label’s identifier is the same as the identifier for its containing function. Inspect
interprets the identifier as a reference to the function, not to the label.
Consequently, you must specify the code location of the label by its statement
number, its line number, or its instruction offset.
Specifying code locations by line number
If no statement begins at the line number you specify, Inspect issues this warning:
Inspect then uses the statement starting at the given line number. If more than one
statement begins on the line you specify, Inspect uses the start of the first
statement.
The STATEMENT code unit and C++ statements
Inspect recognizes these as statements:
Simple C++ statements that are not part of a compound or composite
statement
C++ statements in a compound statement, delimited by braces
The parts of a composite C++ statement (if, for, and so on)
Using the FROM Clause in a Command List
You can use the FROM clause only once in a command list.
Examples
Given a function named class::funct that contains a labeled statement named
error_fix, you can specify these code locations:
These example code locations assume the current scope path #class::funct:
** Inspect warning 117 ** A subsequent line number is assumed: line-number
Code Location Specifies
#class::funct The primary entry point of the function class::funct.
#class::funct.error_fix The code immediately following the label error_fix.
Code Location Specifies
class::funct The primary entry point of the function class::funct.
error_fix + 3S Three statements past the label error_fix.