After you understand the specific
problems identified by the Porting Assistant, it is time to consider
editing your code. There are two types of actions you can take:
- After investigating a flagged problem, you decide it is not a
significant issue for your code. You can stop further reporting of
the problem by using filtering functions.
- You need to change your source code.
The Porting Assistant will filter
- A specific diagnostic on a particular line
- A specific diagnostic in a source file
- A specific diagnostic in any source file
- Any diagnostic containing a specific pattern
You can do the first three filtering operations in either the Editor
or the Builder using a menu pick. The menu picks build a pattern to
match the current diagnostic and add it to the current list of filters.
You accomplish the fourth filtering operation by creating your own
pattern or editing one that the Porting Assistant created.
The Builder has a Filter Manager that lets you edit, disable, enable,
construct, and save sets of filters.
Changing your source code...
If you decide to change your code, the Porting Assistant helps in
several ways. First, you can use any of the editors that are packaged
with the Porting Assistant to make the changes. This works particularly
well because the Porting Assistant steps you through the issues it has
If you have a large number of similar changes to make to multiple
source files, try the Search tool (screen
shot). The top section of this tool searches for a string matching a
regular expression pattern in a set of files in either a single
directory or a directory hierarchy.
For example, the Porting Assistant screen searches all files in a
directory called search_demo for the string printf. The
tool lists all matches in a scrolled window. By double clicking on any
match, the file containing the match is read into the editor.
The replace function is at the bottom of the Search tool. Type the
replacement string for your located string (eg xprintf) in the
Replace With box and select in the scrolled area those matches you
wish to replace. Then click on Replace.
Replace will work in one of two ways depending on the check box to
the right of the Replace button. If Confirm Replace
is checked, Replace will serially bring each replacement location up in
the editor for you to confirm. Without the check box, Replace with do a
batch replacement. Note that a backup file is always created in case you
change your mind.
After you make a change, you will want to know whether your change is
correct and deal with managing the changed source file. Running the
Porting Assistant check again is a first level check. Just go back to
the appropriate check and execute it again. Any source file that passed
the last time and has not changed will not be rechecked.
Compiling, linking and debugging can be done either with command line
tools or using Compaq's visual software development environment,
Compaq FUSE. If you enjoy using the Porting Assistant, you will
likely find the Compaq FUSE environment to be familiar and helpful. The
two products share many tools and concepts.