Download CodeCheck Technical Notes - Summer 2003

Transcript
CodeCheck Technical Notes
http://www.abraxas-software.com
Printed 02/26/06
decimal(9,2) e;
int i;
d = 99D;
e = 1111.11D;
return 0;
}
In the following example the system header file decimal.h is not IBM-273, but IBM-1047. The pragma tells
CodeCheck to go into IBM-1047 mode. When CodeCheck returns to caller it returns to the default [ -E273 ],
unless it had a different type of encoding. This allows CodeCheck to process any IBM C/C++ from any ASCII
machine. Lastly, note here we’re using “e1047.exe” because the decimal.h is in IBM-1047 format, the –4 means
just print the first four lines of the header file.
e1047 -4 decimal.h
??=ifndef __decimal
??=ifdef __COMPILER_VER__
??=pragma filetag ("IBM-1047")
??=endif
Complete compiling appears in the following text, note we have added the –P switch for progress to get a ‘cc -v’
style verbose report. You can see that CodeCheck successfully compiled the entire example and all system
headers. The #pragma message “IBM EBCDIC” is added to indicate that CodeCheck is using ibm.cch to
configure the IBM C keywords that are non-standard to ANSI-C. Note that we’re not using any –Kn switch so
CodeCheck is operating in extended ANSI-C mode.
demont -E273 4.c -ribm.cco -l -m -h -p
Abraxas Software (R) CodeCheck NT version 11.01 B9 DEMO
Copyright (c) 1988-2004, by Abraxas Software, Inc. All rights reserved.
# Rule files are in these directories:
d:\rules\
# Reading from file "ibm.cco"
# Reading from file "ibm.cco"
Checking extended ANSI C file 4.c with rules from ibm.cc:
#
Reading header file "ibm.cch"
IBM EBCDIC
#
Returning to file "4.c"
#
Reading header file <stdio.h>
#
Reading header file <sys/types.h>
#
Returning to file <stdio.h>
CodeCheck Technotes © 1988-2006 by Abraxas Software, Inc.
Page 69