diff --git a/C.Update.ReadMe b/C.Update.ReadMe index 9818ab1..4a9b640 100644 --- a/C.Update.ReadMe +++ b/C.Update.ReadMe @@ -32,5 +32,7 @@ Thanks to: for writing several useful tools for modern Apple II development. * Soenke Behrens, for compiling a list of ORCA/C bug reports and test cases, which has helped me to identify and fix a number of bugs. +* The developers of Csmith (http://embed.cs.utah.edu/csmith/), an + automated compiler testing tool that has helped to find several bugs. --Stephen Heumann (stephenheumann@gmail.com) diff --git a/cc.notes b/cc.notes index 4f1f73f..5eeaf91 100644 --- a/cc.notes +++ b/cc.notes @@ -25,9 +25,12 @@ Updated by Stephen Heumann and Kelvin Sherlock, 2017-2018 8. Two new #pragma ignore bits are defined. See "Compiler changes introduced in C 2.2.0". - 9. Stack repair code is now more efficient. + 9. A new #pragma lint bit is defined for checking *printf() and + *scanf() format strings and arguments. See "Format Checking." + + 10. Stack repair code is now more efficient. - 10. Some new library functions and features from C99 have been + 11. Some new library functions and features from C99 have been added. See "Library Updates." 2.1.1 B3 1. Bugs squashed. See bug notes, below. @@ -133,6 +136,10 @@ p. 256 The #pragma debug directive supports a new bit. If bit 15 is set, ORCA/C generates inline function names for use with assembly-level debugging tools. See "Inline Function Names," below. +p. 257 + +The #pragma expand directive has been changed to use three-digit octal escape sequences (rather than hexadecimal ones) in strings it outputs. (This ensures that subsequent characters in the string cannot be interpreted as part of the escape sequence.) + p. 258 The #pragma ignore directive supports three new bits. @@ -149,6 +156,12 @@ ORCA/C supports // comments. If bit 3 is clear, ORCA/C does not support // comm See "// Comments," below, for a complete description of // comments. +p. 259 + +The #pragma lint directive supports a new bit. If bit 4 (a value of 16) is set, the compiler will check if the format strings passed to the fprintf() and fscanf() families of functions are valid, and if the number and types of arguments passed to them match what the format strings call for. See "Format Checking," below. + +Also, note that the conditions detected by lint checks 1 and 2 are errors under C99 and later C standards. Thus, to make ORCA/C conform as closely as possible to those standards, at least "#pragma lint 3" should be used. + p. 263 1. The discussion of NDAs is on page 40, not page 58. @@ -200,6 +213,14 @@ p. 353 The discussion of _exit() should note that the _exit() function is an extension to ANSI C. +p. 356 + +The fprintf() family of functions has been updated to support several new features specified by C99. Also, the snprintf() and vsnprintf() functions have been added. See "Library Updates," below. + +p. 367 + +The fscanf() family of functions has been updated to support several new features specified by C99. See "Library Updates," below. + p. 375 The discussion of isascii() should note that isascii() is an extension to ANSI C. @@ -297,6 +318,16 @@ Note that inline function names are unrelated to the other types of debug code t (Kelvin Sherlock) +Format Checking +--------------- + +ORCA/C now supports a new #pragma lint bit to enable checking of the format strings passed to the fprintf() and fscanf() families of functions. If #pragma lint bit 4 (a value of 16) is set, the compiler will check if the format strings passed to those functions are valid, and if the number and types of arguments passed to them match what the format strings call for. + +If these lint checks detect any errors, they will produce the error message "lint: invalid format string or arguments," followed by more detailed information about the problem(s) found. + +(Kelvin Sherlock) + + New Headers ----------- @@ -678,6 +709,10 @@ int foo(int[42]); (Kelvin Sherlock) +81. The #line directive was setting the number for the current line, rather than the following one. + +82. Output from #pragma expand could contain string literals that were invalid or did not represent the same strings as those in the original program code. In order to fix this problem, #pragma expand has been changed to use three-digit octal escape sequences (rather than hexadecimal ones) in strings it outputs. (This ensures that subsequent characters in the string cannot be interpreted as part of the escape sequence.) + -- Bugs from C 2.1.0 that have been fixed ----------------------------------- 1. In some situations, fread() reread the first 1K or so of the file.