next up previous 211
Next: do-xxx - Apply source code filter xxx to a set of files
Up: Description of tools
Previous: extmakefile - Modify makefile for use with EXTREME data sets


cmp-xxx - Compare filtered source with original for unwanted changes

Description:
This script checks an original source code file against a version of it run through the one of the source code filter programs in the EXTREME package. It should be invoked under the name `cmp-xxx' to check the effects of the filter `xxx'.

The available filters xxx are:

  • inscnf - Wrap %VAL invocations in CNF_PVAL calls

  • crepint - Change int type to INT_BIG in C

  • frepint - Change INTEGER to INTEGER * 8 in Fortran


If a file containing the filtered source code already exists, it can be given as the second command-line argument, otherwise the file given as the first command-line argument will be run through the appropriate filter before the comparison is made.

The script uses its knowledge of the changes made by each of the filters to identify changes which are unexpected. The idea is to serve as a check that the the source code filter program itself has not made a mistake. The parsing done by this script is much less careful than that done by the filters, so it may make mistakes - apparent discrepancies reported by this script should be investigated, but may well not indicate genuine problems.

If an apparent discrepancy is found, the script prints the first line from each file in which a discrepancy exists. The text printed is not the text as it appears in the files, but a version mangled by this program for comparison - whitespace, formatting, and other things may have been changed. The printed text should however make it easy enough to find the relevant point in the input file.

If there is an apparent discrepancy the exit status of the program will be non-zero; if the files match then there is no output and exit status is zero.


Usage:
cmp-xxx file [ newfile ]



next up previous 211
Next: do-xxx - Apply source code filter xxx to a set of files
Up: Description of tools
Previous: extmakefile - Modify makefile for use with EXTREME data sets


Starlink System Note 73
Mark Taylor
13 August 2001
E-mail:ussc@star.rl.ac.uk

Copyright © 2001 Council for the Central Laboratory of the Research Councils