Annotation of researchv10no/cmd/lcc/LOG, revision 1.1.1.1

1.1       root        1: 10/25/88:
                      2: lcc is an ANSI C compiler available to friendly users on coma.
                      3: 
                      4: Bit fields are parsed but ignored.  Trigraph sequences and the extended
                      5: character set are not supported.  The code for register variables needs
                      6: improvement.  The only cases now known to yield incorrect code involve
                      7: C++ output and programs that run out of registers, but there must be
                      8: more.  -g seems to work with pi, but it's very green.
                      9: 
                     10: ANSI-style header files are in /usr/include/lcc, which lcc searches.
                     11: A few prototypes may differ from what is actually in libc.a; the
                     12: consequence is usually a type error.  A header file for some V9
                     13: functions is on the way; more later on this.
                     14: 
                     15: For a man page, run "man lcc" or "troff -man /usr/cwf/book/man/lcc.1.v9".
                     16: Mail bug reports to both cwf and princeton!drh (Dave Hanson).
                     17: Please include a short program that exposes the bug.  Thanks.
                     18: 
                     19: 11/8/88:
                     20: fixes several bugs with error handling, float and string constants,
                     21: register structs, and programs that exhaust register variables.
                     22: makes code for char and short int functions compatible with cc's code.
                     23: 
                     24: 11/17/88:
                     25: fixes bugs in spills, in the declaration of longjump in lcc's
                     26: <setjmp.h>, and in the type system ("char" had compared equal to
                     27: "signed char", which ansi forbids).  improves error recovery.  plus
                     28: internal changes that are theoretically invisible.
                     29: 
                     30: it also puts some formals and locals in registers; "man lcc" elaborates.
                     31: the increased demand for registers may expose compiler bugs that have
                     32: been in hiding.  if you have regression tests, try them.
                     33: 
                     34: 12/8/88:
                     35: fixes sizeof("x"), overzealous reuse of common subexprs, and a loop in
                     36: the spill emitter.  improves error reporting and code for many ++/--
                     37: ops (but prefix versions on registers still need work).  folds the
                     38: difference of two constant pointers.  defines standard "offsetof"
                     39: macro.
                     40: 
                     41: 12/13/88:
                     42: fixes compiler crashes on certain spills in nested conditional exprs.
                     43: fixes bugs in hex char constants, in exprs with chains of unsigned
                     44: mods and divisions, and in *x=*x when x is volatile.  uses gcc's
                     45: preprocessor to offer more ANSI extensions.  adds bit fields, tho
                     46: they're pretty green, the layout's unique (see the man page), and the
                     47: code needs optimization.
                     48: 
                     49: 12/19/88:
                     50: changes some diagnostics.  handles arbitrarily long lines.  emits
                     51: slightly better code for switches and functions that return structs.
                     52: fixes an infinite loop when undeclared identifiers appeared in
                     53: initializers, an incorrectly formatted error message for illegal
                     54: characters, and bad code for x:goto x and for *f()=g() when g returns
                     55: a struct.  ignores -O, because /lib/c2 can trash lcc's code.  adds -n,
                     56: which compiles code to detect certain zero-pointer errors; the man
                     57: page elaborates.
                     58: 
                     59: 1/5/89:
                     60: improves diagnostics.  deletes warnings about unused return values,
                     61: except when they're structures.  fixes minor errors in the standard
                     62: include files.  stops losing the token following asm("...").  emits
                     63: slightly worse code for nested calls, in preparation for a mips
                     64: target.  several internal changes that should have no effect.
                     65: 
                     66: 1/9/89:
                     67: improves entry code for some functions.  gets clr/inc instructions even
                     68: if the 0/1 is expressed oddly (eg, 0x1).  corrects bad code for
                     69: (unsigned)c==0xff, for f(g().b) when b's offset >0, and for -u>0 for
                     70: unsigned u.  returns to the old code for nested calls, so f(x?h():0),
                     71: f(x&&h()), and f(x||h()) work again.  corrects minor flaws in string.h.
                     72: 
                     73: 2/1/89:
                     74: 
                     75: improves diagnostics.  improves handling of long parameter lists, long
                     76: string constants, and integral constants between 2^31-1 and 2^32-1.
                     77: responds to constant overflow in a machine-independent fashion.
                     78: flattens nested calls (for the mips target).  corrects bad code for
                     79: a[2*i]=f(a[2*i]), (double)(float)0.3, stab entries for initialized
                     80: statics, and some nested conditionals.  assigns registers differently:
                     81: r0-5 are now for temporaries, and r6-11 for variables.  fixes several
                     82: crashes and assertion failures:  if you've had some, try them now;
                     83: otherwise ignore.
                     84: 
                     85: 2/10/89:
                     86: 
                     87: -A now warns about calls to functions without prototypes.  diagnostics
                     88: now include only the line number and omit the character position.
                     89: empty declarations in parameter lists (eg, "f() struct s {int x;};")
                     90: are now errors, and other empty declarations (eg, "int;") now draw
                     91: warnings.  no longer forbids const struct members (eg, "struct {const
                     92: int a,b;}").  several internal but theoretically invisible changes.
                     93: 
                     94: 2/11/89:
                     95: 
                     96: fixes an endless compiler loop and a bug in bit field initialization
                     97: that showed up only on the mips.
                     98: 
                     99: 2/14/89:
                    100: 
                    101: improves constant folding (eg, 0&&x, -1&x).  fixes bugs:  applying
                    102: sizeof to explicit array types sometimes made lcc loop or crash; some
                    103: dissimilar floating point constants (eg, -111111.0 and
                    104: -111111.00000000002) were treated as equivalent during constant
                    105: folding; some conditional exprs involving constants gave a compiler
                    106: error (eg, i = 5.6 && i ? 1 : 2;) or bad code (eg, *p = (int *)0 &&
                    107: *(int *)0 ? 4 : 5;).  fixes a bug in the code that spills a temporary
                    108: register when they're all gone; numerical programs were the most likely
                    109: to have been effected.
                    110: 
                    111: 2/17/89:
                    112: 
                    113: fixes an assertion failure in the code that spills a register.
                    114: 
                    115: 2/24/89:
                    116: 
                    117: /usr/include/nlcc shipped.  it's a directory of mostly new .h files for
                    118: lcc.  in 10 days or so, these files will replace those now in
                    119: /usr/include/lcc, which lcc searches before /usr/include.
                    120: 
                    121: fio.h, libc.h, and u.h are non-ansi local contributions from various
                    122: sources.  the rest are intended to match the standard, which can be
                    123: irritating but is necessary for portability.  the standard errno.h is
                    124: omitted because the local one suits ansi.
                    125: 
                    126: users interested more in convenience than in portability are welcome
                    127: to edit fio.h, libc.h, and u.h and to add new .h files; do so on
                    128: bowell or your changes will get lost.  don't edit the other headers --
                    129: they're maintained mechanically from another source.  if you find a bug
                    130: in one of these, post cwf and princeton!drh.  for portability, we want
                    131: to keep non-standard stuff out of these files, but we do want to hear
                    132: about bugs.
                    133: 
                    134: these are just headers.  lcc will continue to use cc's libraries
                    135: indefinitely.
                    136: 
                    137: 3/1/89:
                    138: 
                    139: in the absence of -g, removes immediate tail recursion from
                    140: non-variadic functions.  old-style, variadic, tail-recursive functions
                    141: are optimized incorrectly, so give a prototype.
                    142: 
                    143: -s now controls which switches become branch tables; the man page
                    144: elaborates.  also, the man page now warns of bad code for switches over
                    145: 32kb; repairs soon.
                    146: 
                    147: fixes bug that put formals in scope too early, which caused bad code
                    148: or core dumps for some programs like "int a;f(a)int a[sizeof a];{}".
                    149: no longer treats 1/0 and similar expressions as constant expressions.
                    150: corrects diagnostics and compiler crashes for certain erroneous
                    151: inputs.
                    152: 
                    153: adds gauss to distribution list.
                    154: 
                    155: 3/10/89:
                    156: 
                    157: implements 2c's structure extensions, except for in-line structure
                    158: exprs.  replaces -s with -d to avoid conflict with ld's -s.  adds -v,
                    159: which prints commands as they are executed; see the man page.  uses the
                    160: two-operand instructions like addl2 a little more often.  places
                    161: initialized const data in a readonly segment.  bags casel
                    162: instructions, so switches over 32kb now work.  no longer omits
                    163: unreferenced, anonymous types from -g symbol tables.  improves
                    164: diagnostics.
                    165: 
                    166: corrects a few bugs in /usr/include/nlcc, which replaces
                    167: /usr/include/lcc on 3/14.  speak now or forever hold your peace.
                    168: 
                    169: 3/11/89:
                    170: 
                    171: corrects bad code for switches and for "y>(float)0.0?y:-(double)y".
                    172: avoids an ld bug with external initialized consts.
                    173: deletes -B's "using" message.
                    174: 
                    175: 3/16/89:
                    176: 
                    177: /usr/include/lcc shipped, a couple of days later than promised.  it's
                    178: exactly what's been soaking in /usr/include/nlcc, in which fio.h,
                    179: libc.h, and u.h were the latest local contributions (at least on
                    180: coma), and the rest were conformed with the standard, except that the
                    181: standard errno.h was omitted because the local one suits ansi.
                    182: 
                    183: the old headers are in /usr/include/olcc, so try -I/usr/include/olcc
                    184: if you get in a jam.  /usr/include/nlcc unshipped.
                    185: 
                    186: users interested more in convenience than in portability are welcome
                    187: to edit fio.h, libc.h, and u.h and to add new .h files; do so on
                    188: bowell or your changes will get lost.  don't edit the other headers --
                    189: they're maintained mechanically from another source.
                    190: 
                    191: these are just headers.  lcc continues to use cc's libraries.
                    192: 
                    193: 3/23/89:
                    194: 
                    195: fixes a register fragmentation bug by eschewing odd double registers;
                    196: if you use a lot of doubles, retry any regression tests that you might
                    197: have.  fixes bugs in a few diagnostics.  assert.h may now be included
                    198: more than once without calamity.  -P prints function prototypes for all
                    199: defined functions and globals in a form suitable for use in header
                    200: files; see the man page.  plus several internal changes that should
                    201: have no effect.
                    202: 
                    203: 3/29/89:
                    204: 
                    205: fixes several spill bugs; code with large double exprs is most
                    206: likely to have been bogus.  accepts wide-character literals and treats
                    207: them like ordinary character literals.  treats `long int' and `long
                    208: double' as types distinct from int and double, but with the same sizes
                    209: and alignments; they had been treated as identical types, which is
                    210: wrong.  deletes bogus diagnostics for:
                    211: 
                    212:        int *const p = (int *const)0;
                    213:        int *x = (f(), 0);
                    214:        typedef int I;main(){I I(I);}
                    215: 
                    216: 3/29/89:
                    217: 
                    218: fixes two bugs new in this morning's (3/29) lcc:
                    219: 
                    220: calls to char and short functions gave a fatal compiler error.
                    221: 
                    222: type `unsigned long int' was missing; variables so declared were taken
                    223: to be `long int', so, for example, right shift of an unsigned long
                    224: erroneously extended the sign bit.  the repair causes non-trivial
                    225: expressions involving long int, long unsigned, and long double to have
                    226: types int, unsigned, and double, respectively.  this behavior should
                    227: not affect the generated code because ints *are* long ints, etc., but
                    228: it might mask type errors.
                    229: 
                    230: 4/16/89:
                    231: 
                    232: bug fixed:  casts to enum types weren't treated as ints.
                    233: 
                    234: new feature:  in asm("string") occurrences of `%name' are replaced by
                    235: the address or register for the identifier `name' if `name' is
                    236: visible.  the man page elaborates.
                    237: 
                    238: /usr/include/lcc now holds only the headers specified by the ANSI
                    239: standard.  The local headers (fio.h, libc.h, u.h) and a local version
                    240: of stdio.h are now in /usr/include/libc.  lcc now searches the latter
                    241: before the former, so the default will find the local stdio.h.  -N
                    242: tells lcc to discard its usual search list and use only directories
                    243: named in explicit -I args.  So use "lcc -N -I/usr/include/lcc" to
                    244: ensure conformance with the ANSI standard.  Report bugs in the standard
                    245: headers to cwf.  Report bugs in the local headers to rob.  Don't edit
                    246: either set directly -- they're maintained mechanically from central
                    247: sources, so edits will get lost.
                    248: 
                    249: 4/19/89:
                    250: 
                    251: some function definitions inconsistent their prototypes went
                    252: undetected (eg, extern int f(int); void f(x)int x;{}).
                    253: 
                    254: long ints were erroneously promoted to ints.  this bug showed up in
                    255: prototype errors (eg, extern f(long); f(n) long n; {}).
                    256: 
                    257: implements 2c's in-line struct exprs ((struct foo) {...}).  the code's
                    258: poor, and run-time alignment errors can occur for incomplete exprs.
                    259: improvements soon.
                    260: 
                    261: structs have always been aligned to suit their strictest member.  to
                    262: fix some alignment crashes on the mips, they are now additionally
                    263: guaranteed int alignment (four bytes on all current targets).  so
                    264: recompile all modules that use structures composed entirely of chars
                    265: and shorts.  yacc and lex produce some.
                    266: 
                    267: 4/28/89:
                    268: 
                    269: "-(unsigned long)x" crashed the compiler.  bit fields and functions
                    270: were erroneously permitted as arguments to sizeof.  pointers to enums
                    271: were not treated as pointers to ints, which drew erroneous type errors
                    272: (eg, in "enum {...} *ap; int *x = ap;").
                    273: 
                    274: local arrays are now guaranteed int alignment.  the old, weaker
                    275: alignment sometimes made array initialization code crash on the mips.
                    276: 
                    277: "#pragma ref id" now simulates a reference to id; it may be used to
                    278: suppress a warning about an otherwise unreferenced variable (eg, a
                    279: sccs id).
                    280: 
                    281: -N now turns off the non-ansi local extensions in addition to restricting
                    282: the search for header files to only those directories named by -I.
                    283: 
                    284: 5/1/89:
                    285: 
                    286: fixes bug in some subscript computations for multi-dimensioned char
                    287: arrays of length 4 or less.  this bug occurred only in the presence of
                    288: char arrays in which each element was initialized or initialized
                    289: structs with bit fields.
                    290: 
                    291: 5/11/89:
                    292: 
                    293: improves code for arithmetic and boolean ops on chars and shorts.  if
                    294: you use these a lot, run any regression tests that you have.
                    295: 
                    296: the algorithm used to induce register variables has been changed.
                    297: registers are assigned to locals and parameters if their weighted
                    298: reference count is at least 3.  each reference counts adds X, where X
                    299: starts out at 1 and is multiplied by 10 in each loop, by 1/2 in each
                    300: then/else, and by 1/10 in each switch.
                    301: 
                    302: 4/28's fix that made `pointer to enum' equivalent to `pointer to int'
                    303: was too permissive.  warnings are now issued for assignments between
                    304: `pointer to int' and `pointer to enum'.  all other combinations are
                    305: errors.
                    306: 
                    307: structs are no longer guaranteed int alignment.  they are still aligned
                    308: to suit their strictest member.  recompile modules that use structures
                    309: composed entirely of chars and shorts.  yacc and lex produce some.
                    310: 
                    311: tail recursion is no longer removed.  errors occurred when locals were
                    312: aliased.
                    313: 
                    314: some valid combinations of qualified pointers in result arms of ?:
                    315: caused erroneous diagnostics, and incorrect uses of types pointer and
                    316: int in result arms of ?: went undetected.
                    317: 
                    318: some subscript computations for multi-dimensioned char arrays of
                    319: length 4 or less were incorrect because their types were mangled.
                    320: this bug occurred only in the presence of char arrays in which each
                    321: element was initialized or initialized structs with bit fields.
                    322: 
                    323: casts from integer types to long double were silently ignored.  real
                    324: constants suffixed by "l" or "L" were erroneously type double; they're
                    325: now type long double.
                    326: 
                    327: UINT_MAX was missing from <limits.h>.  time_t, wchar_t, size_t and
                    328: clock_t are now protected from redefinition.  the compiler erroneously
                    329: accepted and silently ignored preprocessor statements; except for
                    330: #pragma, they now draw an error.
                    331: 
                    332: 5/19/89:
                    333: 
                    334: f(){int (*a)[];(*a)[5] = 0;} is now accepted.
                    335: 
                    336: variables referenced mainly in deeply nested control structure were
                    337: erroneously reported as unreferenced.
                    338: 
                    339: no more arbitrary limit on the number of scope levels.
                    340: 
                    341: 5/27/89:
                    342: 
                    343: Type casts were erroneously accepted as l-values.  On the vax, bad code
                    344: was silently generated for signed div and mod ops when the destination
                    345: was a (signed or unsigned) char or short.
                    346: 
                    347: 6/2/89:
                    348: 
                    349: now accepts "int a = 3;extern int a;".  some constant expressions with
                    350: casts were not accepted as constants (eg, ~((unsigned short) 0)).
                    351: fixes bad code for struct args whose size is not divisible by four.
                    352: 
                    353: 6/8/89:
                    354: 
                    355: improves diagnostics.  some valid field references in extended
                    356: structures were erroneously flagged as errors.  e&0 always returned 0
                    357: and never evaluated e, even if e had side effects.  ignores
                    358: unrecognized preprocessor control lines.
                    359: 
                    360: 8/3/89:
                    361: 
                    362: fixes compiler crashes caused by long string constants with lots of
                    363: escaped characters.
                    364: 
                    365: the va_start macro in stdarg.h did not handle char or short arguments
                    366: correctly.
                    367: 
                    368: on the vax, bad code was generated for some assignments to unsigned
                    369: char (eg, "char a[10]; unsigned char b = a[i];").
                    370: 
                    371: signed divisions by a constant power of two are no longer performed by
                    372: shifts; the results were inconsistent with the standard, which
                    373: requires that (a/b)*b + a%b == a.
                    374: 
                    375: some illegal casts in constant expressions were erroneously accepted
                    376: (eg, "int x, y=(int)&x;").
                    377: 
                    378: missing tags were erroneously permitted in some struct declarations
                    379: (eg, "struct *p;").
                    380: 
                    381: now allows a terminal comma in enums, unless -N (strict ANSI) is
                    382: specified.
                    383: 
                    384: warns about switch statements with no cases and about functions
                    385: declared static but never defined or referenced.
                    386: 
                    387: with -A, warnings about missing prototypes are now issued only once
                    388: instead of once per call.
                    389: 
                    390: doug has merged the man pages for cc and lcc.
                    391: 
                    392: 8/8/89:
                    393: 
                    394: fixes bad code for x=y<<1 when x is a short.
                    395: 
                    396: 8/29/89:
                    397: 
                    398: preprocessor generated lines of the form `# n "name"' and `# n' are
                    399: accepted.
                    400: 
                    401: repeated initializations of an array type defined by a typedef
                    402: (typedef char str[]; str a = "hi", b = "there";) elicited incorrect
                    403: error messages.
                    404: 
                    405: on the mips, some initialized structures that began with a char or
                    406: short were misaligned.
                    407: 
                    408: shamash and bartok added to the shipping list.
                    409: 
                    410: 9/16/89:
                    411: 
                    412: better code for comparing bit fields with 0 and for setting them to all
                    413: 1s or 0s; manipulating 1-bit fields is as efficient as using flags with
                    414: explicit | and & operators.
                    415: 
                    416: eliminates more dead code.
                    417: 
                    418: eliminates multiple copies of some constants.
                    419: 
                    420: fixes bad code for multiple assignment to bit fields in the same word
                    421: (eg, struct { unsigned x:1,y:1; } *p; p->x = p->y = 1;).
                    422: 
                    423: fixes bad code for some logical operators with constant operands (eg,
                    424: x||1).
                    425: 
                    426: fixes a compiler crash on the mips for some calls that pass a float and
                    427: return a struct.
                    428: 
                    429: 9/29/89:
                    430: 
                    431: takes care to emit only non-empty .s files on the mips, whose assembler
                    432: cares.  corrects bad mips code in some cases when one of the first four
                    433: formals gets assigned to a register and is declared (old-style) to be a
                    434: (single-precision) float.
                    435: 
                    436: 10/4/89:
                    437: 
                    438: in unions with bit fields, the offsets for subsequent fields were
                    439: wrong.  unions comprised entirely of bit fields were thought to be of
                    440: size 0, which drew a bad diagnostic.  math.h's HUGE_VAL is now less
                    441: conservative.  several numbers in limits.h were wrong.
                    442: 
                    443: 10/21/89:
                    444: 
                    445: hex escapes now properly include the longest possible run of hex digits
                    446: after the \x, even when the value is too big for a char.  lcc truncates
                    447: and warns about octal and hex escapes with values that won't fit in 8
                    448: bits.  it also warns about undefined escapes like \c.
                    449: 
                    450: local declarations of static functions that were previously defined
                    451: drew erroneous mismatched declaration warnings.
                    452: 
                    453: better code for e1?e2:0.
                    454: 
                    455: fixes bad struct returns for functions that explicitly declare more
                    456: register locals than lcc allows for the target.
                    457: 
                    458: different code for spills.
                    459: 
                    460: on the 68020, fixes bad code for "return i%j".
                    461: 
                    462: limits.m4 now casts INT_MIN to int and LONG_MIN to long.  without the
                    463: casts, the 0x80000000 ended up unsigned.
                    464: 
                    465: 10/24/89:
                    466: 
                    467: for new-style functions, float actuals corresponding to int or long
                    468: formals went unconverted.  eg, "f(int x) { float y; f(y); }" failed to
                    469: convert y.
                    470: 
                    471: error messages for the redeclaration of enum ids misreported the
                    472: location of the previous declaration.
                    473: 
                    474: on the vax, <unsigned constant> >> <anything> generated bad code.
                    475: 
                    476: on the vax, casts that narrowed and then widened an indexing expr
                    477: generated bad code.
                    478: 
                    479: limits.h substitutes exprs for some hard constants to reduce machine
                    480: dependencies.
                    481: 
                    482: 11/3/89:
                    483: 
                    484: a missing } at the end of file drew a garbled diagnostic.
                    485: 
                    486: lcc crashed when a conditional expr fed a binary op that fed a
                    487: bit field assignment.
                    488: 
                    489: lcc crashed when the value of x?y:0 was not used.
                    490: 
                    491: new driver for lcc.  no -M.  preprocessor and compiler are now
                    492: connected with a pipe.  flags must now precede file names and
                    493: libraries.
                    494: 
                    495: 11/7/89:
                    496: 
                    497: on the vax, fixed bad code for *s&&*s++.
                    498: 
                    499: 11/17/89:
                    500: 
                    501: casts of constants to illegal types caused an assertion failure.  no
                    502: longer warns about switches with only the default case.  now allows
                    503: more generated labels.  the new driver hung on long programs with too
                    504: many errors.
                    505: 
                    506: on v9 vaxes, now supplies -J to the assembler.
                    507: 
                    508: on tempel, RAND_MAX was too small.  on all mips machines, lcc exited
                    509: with status 0 even with errors.  an omission from the mipsco docs led
                    510: to an incompatibility with code from cc for new-style functions with
                    511: single-precision floats as arguments 2, 3, or 4.
                    512: 
                    513: 12/26/89:
                    514: 
                    515: constants burn less time and space.  large initializations compile much
                    516: faster.
                    517: 
                    518: vertical tabs and form feeds were previously treated as newlines;
                    519: they're now treated as blanks.
                    520: 
                    521: ~~x and -(-x) have been replaced with just x.
                    522: 
                    523: specifying both -A and -n drew inappropriate missing prototype
                    524: messages.
                    525: 
                    526: types defined in parameter lists were inaccessible within the
                    527: function.
                    528: 
                    529: the compiler crashed when the value of "x,y" was used and y was a
                    530: relational or conditional expr.
                    531: 
                    532: the compiler crashed when a void (eg, via a cast) was assigned to a bit
                    533: field.
                    534: 
                    535: on the mips, an invalid instruction was generated for a register float
                    536: used as argument 2, 3, or 4.  the assembler rejected it.
                    537: 
                    538: on the mips, literals have been moved to the text segment.
                    539: 
                    540: on the mips, -p now works.  as with cc on (only) these machines, it
                    541: does not count calls.  for that, use "pixie", which works with lcc's
                    542: a.outs.
                    543: 
                    544: on the 68020, -g generated incomplete symbol table information for
                    545: structures that were used before being defined
                    546: (eg "struct A; g(struct A *x) {} struct A { int a,b; };")
                    547: 
                    548: CLOCKS_PER_SECOND is now 1000000 everywhere.  that's now consistent
                    549: with the clock function on the mips and 68020 machines, and it's
                    550: irrelevant on the vaxes, because their libraries don't include the
                    551: function.
                    552: 
                    553: numerous internal improvements, all theoretically invisible.
                    554: 
                    555: 2/2/90:
                    556: 
                    557: sizeof erroneously returned an int.  it now returns an unsigned as
                    558: dictated by ANSI.  WARNING: the pre-ANSI sizeof returned an int, so lcc
                    559: has been masking a potential problem with the conversion of pre-ANSI
                    560: programs.
                    561: 
                    562: casts in integer constant exprs in array bounds, enum defs, and field
                    563: widths sometimes gave bad values.
                    564: 
                    565: string constant arguments of asm directives were handled wrong, which
                    566: made the compiler crash or emit bad diagnostics.
                    567: 
                    568: comparisons of ints and pointers like i==(int*)1 crashed the compiler.
                    569: 
                    570: arrays with unspecified bounds are now noted as an `incomplete array'
                    571: in error messages.
                    572: 
                    573: reuses of common subexprs in conditional exprs sometimes generated bad
                    574: code.
                    575: 
                    576: on the vax, bad code was generated for unsigned right shift by a
                    577: non-constant when r0 was busy.
                    578: 
                    579: on the suns, the register save mask at function entry and exit for
                    580: floating point registers was incorrect.
                    581: 
                    582: lcc -E foo.i (foo.s) erroneously compiled (assembled) the given file.
                    583: 
                    584: several theoretically transparent internal changes.
                    585: 
                    586: 2/20/90:
                    587: 
                    588: lcc no longer crashes when presented with local arrays of undefined
                    589: structs or with calls to functions that return const structs.
                    590: 
                    591: u%2^n now generates the same code as u&(2^n-1) for unsigned u and
                    592: constant 2^n.
                    593: 
                    594: on the suns, RAND_MAX is now 2^31-1, which contradicts the man page but
                    595: is consistent with what rand() seems to do.
                    596: 
                    597: 2/21/90:
                    598: 
                    599: fixes bad code introduced yesterday on all targets for u%2^n for
                    600: unsigned u and constant 2^n.
                    601: 
                    602: 2/28/90:
                    603: 
                    604: multiple assignments to bit fields in the first word of a struct (like
                    605: struct {unsigned a:1,b:1;} x; x.a=x.b=1;) no longer generate bad code.
                    606: 
                    607: extra parentheses in declarations (like int *(x(int));) sometimes crashed
                    608: the compiler.
                    609: 
                    610: the driver sometimes erroneously removed input .o files.
                    611: 
                    612: -Wp<arg> now passes <arg> to the preprocessor.  -Wa, -Wl, and -Wf do
                    613: likewise for the assembler, linker, and compiler proper.  <arg> is
                    614: passed untouched; if the recipient expects a leading dash, give it
                    615: explicitly.
                    616: 
                    617: -T is gone.  use -Wp-T instead.
                    618: 
                    619: 3/2/90:
                    620: 
                    621: fixed incorrect optimization of i%1 on all machines.
                    622: 
                    623: on the vax, -Wf-k now avoids some of the instructions that may fail
                    624: when used to access i/o space.  it does not protect against all
                    625: dangers:  don't touch i/o space via the program counter, floating point
                    626: instructions, struct copies (including struct args and return values),
                    627: or calls (eg, don't index a table of function pointers with an i/o
                    628: cell).  i can't thoroughly test this option myself, so beware.
                    629: 
                    630: 3/8/90:
                    631: 
                    632: relaxes an overzealous assert() in the register spiller.
                    633: 
                    634: many internal cleanups, all theoretically invisible outside.
                    635: 
                    636: 3/17/90:
                    637: 
                    638: the compiler was crashing on x+=(const int)1
                    639: 
                    640: on the mips, fixes bad code for functions that take a double or float
                    641: as arg#1 and return a struct.
                    642: 
                    643: on the vax, slightly different tradeoffs between movl $_x and moval _x.
                    644: 
                    645: 3/26/90:
                    646: 
                    647: better assignment of variables to registers.  explicit register dcls
                    648: are still obeyed first, but any remaining regs are now assigned to
                    649: variables in order of estimated payoff.
                    650: 
                    651: bad floating constants like 1e and 1e+ were erroneously accepted.
                    652: 
                    653: diagnostics for illegal break and continue statements were garbled.
                    654: 
                    655: inline struct expressions now accept struct-valued fields, eg
                    656: struct Point { int x, y; } p, q;
                    657: struct Rectangle { struct Point min, max;} r = (struct Rectangle){p, q};
                    658: 
                    659: on v9 vaxes, lcc now emits some symbol table data even without -g.  the
                    660: intent is to mimic cc, though lcc documents globals as well as locals
                    661: and formals.
                    662: 
                    663: compiler flags are no longer required to precede filenames.  like cc,
                    664: they may appear anywhere but are processed before any files.
                    665: 
                    666: lcc, like cc, now removes a .o file iff exactly one source file (.c,
                    667: .s, .i) appears and no other file (source, object, library) or -l
                    668: option appears.
                    669: 
                    670: 5/9/90:
                    671: 
                    672: warnings are no longer issued for calls to struct functions in which
                    673: the returned struct is not used.
                    674: 
                    675: lines containing only white space and one # are now ignored.
                    676: 
                    677: -N now suppresses recognition of asm("...").
                    678: 
                    679: ansi multibyte characters like 'abc' are now accepted, and lcc warns
                    680: about ignoring the excess characters.
                    681: 
                    682: -P now prints char* even if a typedef for char* has been defined.
                    683: 
                    684: sizeof(L'x') is now correctly the same as sizeof(wchar_t), which is 1.
                    685: sizeof('x') is still the same as sizeof(int), as it must be.
                    686: 
                    687: for constant y, 0&&y (0||y) erroneously returned y instead of y!=0.
                    688: 
                    689: initializing char a[N] with a string of exactly N chars caused the
                    690: trailing null byte to be omitted from other N-char strings appearing
                    691: before the offending initialization.
                    692: 
                    693: the value of bit field assignments was erroneously taken to be the
                    694: right operand instead of the value of the left operand.  eg, for
                    695: an unsigned 3-bit field x, f(b.x=15) passed 15.  it now passes 7.
                    696: 
                    697: casts and structs returned by functions were erroneously permitted as
                    698: l-values.
                    699: 
                    700: exprs like &(((struct foo)0)->x[0]) and array-sizeof(array) were not
                    701: recognized as constant.  they were thus erroneously forbidden in
                    702: initializers.
                    703: 
                    704: casts in the operands of ?: sometimes caused an assertion failure.
                    705: 
                    706: using the value from a postincrement or postdecrement of a bit field
                    707: caused an assertion failure.
                    708: 
                    709: legal comparisons of qualified and unqualified compatible pointers were
                    710: erroneously diagnosed as type errors.
                    711: 
                    712: for function f, &f was erroneously diagnosed as an error.
                    713: 
                    714: types `function returning T' and `array of T' were not uniformly converted
                    715: to `pointer to function returning T' and `pointer to T', respectively.
                    716: 
                    717: char *a; void *b; a?b:c was erroneously diagnosed as a type error.
                    718: 
                    719: initialization of automatic structs with const fields was erroneously
                    720: diagnosed as an assignment error.
                    721: 
                    722: types other than int, signed int, or unsigned int were erroneously
                    723: permitted for bit fields and const and volatile qualifiers were
                    724: erroneously forbidden.
                    725: 
                    726: repeated block-level declarations for functions were erroneously
                    727: diagnosed as redeclaration errors.
                    728: 
                    729: valid assignment of pointers to qualified or unqualified versions of
                    730: compatible types was erroneously diagnosed as a type error, e.g.,
                    731: const char *a;const char *volatile *b=&a;
                    732: 
                    733: on the 68020, lcc gave bad code for x=f(x) where f returns a struct.
                    734: 
                    735: on the 68020, lcc erroneously converted floats and doubles to ints by
                    736: rounding.  it now correctly truncates any fraction.
                    737: 
                    738: on the 68020 and mips, lcc gave bad code for calls in which the
                    739: function was computed with another call, like (*g(f(1)))(2).
                    740: 
                    741: on the mips, -p caused prof to report incorrect file names.
                    742: 
                    743: on the mips, fixes bad code for f(x<op>y) when x is a floating point
                    744: register and <op> is an augmented assignment.
                    745: 
                    746: on the vax, fixes bad code for signed comparisons of chars with
                    747: constants not in [-0x80..0x7f] and of shorts with constants not in
                    748: [-0x8000..0x7fff].  lcc treats plain chars as signed chars, so they
                    749: were afflicted too.
                    750: 
                    751: on the vax, fixes bad code for u>0 and u<=0, for any unsigned expr u.
                    752: 
                    753: the dummy parameter names were removed from the ansi include files.
                    754: eg, f(int x) is now f(int) instead.  
                    755: 
                    756: limits.h was rewritten to use simpler exprs and to avoid casts.
                    757: #if misevaluated some of the old exprs, and it doesn't do casts.
                    758: 
                    759: don't use the unsigned constant suffix (eg, 0u) in #if commands.
                    760: the preprocessor can't cope.
                    761: 
                    762: numerous theoretically invisible internal improvements.
                    763: 
                    764: 5/9/90:
                    765: 
                    766: The lcc compiler now passes the conformance section of Version 1.09 of
                    767: the Plum Hall Validation Suite for ANSI C, subject to the restrictions
                    768: below.
                    769: 
                    770: We do not have a conforming preprocessor or library.
                    771: 
                    772: The lcc command must use -N and enable trigraphs with -Wp-T.  It must
                    773: use -I to search only the ANSI standard headers.  It may need to
                    774: undefine some of the system-specific pre-defined symbols;  -v exposes
                    775: these.
                    776: 
                    777: The only versions of lcc tested to date are the ones running on the SGI
                    778: 4D/240S under IRIX System V Release 3.2.1, on the VAX 8550 under
                    779: UNIX V10, and on the Sun-3 under SunOS Release 4.0.
                    780: 
                    781: 5/11/90:
                    782: 
                    783: for float constant x, -x was not recognized as constant.
                    784: 
                    785: for volatile x, x++ drew unwarranted warnings.
                    786: 
                    787: 7/6/90:
                    788: 
                    789: stores enums in unsigned/signed chars, unsigned/signed shorts, or ints
                    790: depending on the range of the enum constants.  this change may alter
                    791: struct layouts and the size of globals, so discard old object files
                    792: that use enums.  it also causes diagnostics when new-style declarations
                    793: are mixed with old-style definitions for functions with enum arguments,
                    794: so enum foo {a,b,c}; int f(enum foo); ... f(x) enum foo x; {...}
                    795: is equivalent to int f(char); ... f(x) char x; {...}
                    796: which is an error because the prototype in the declaration doesn't
                    797: match the prototype inferred from the definition (which is int f(int)).
                    798: 
                    799: permits up to 127 formals.
                    800: 
                    801: limits identifiers and numeric constants to 64 characters;
                    802: string constants can have up to 4096 characters.
                    803: 
                    804: better diagnostics; some warnings are now errors.
                    805: 
                    806: eliminates more branch chains.
                    807: 
                    808: on the mips, lcc now truncates constant shift counts to 5 bits.  the
                    809: assembler did this before, but it squawked first.
                    810: 
                    811: -t produces code to print trace messages at function entry & exit.
                    812: 
                    813: the driver now ignores duplicate `.o' files, eg, `lcc x.c x.o' is
                    814: identical to `lcc x.c'.
                    815: 
                    816: provides errno.h, which simply includes /usr/include/errno.h.
                    817: 
                    818: numerous internal improvements, all theoretically invisible.
                    819: 
                    820: errors fixed:
                    821: 
                    822: erroneously permitted 0x as a hexadecimal constant.
                    823: 
                    824: failed to treat (double)<unsigned constant> as constant.
                    825: 
                    826: did not detect overflow in enumeration constants, eg, for B in
                    827: enum {A=INT_MAX, B}.  it still fails to detect underflow/overflow in
                    828: constant expressions, which it really ought to do.
                    829: 
                    830: erroneously permitted declarations and definitions for functions
                    831: returning unknown structures.
                    832: 
                    833: erroneously permitted application of unary + to any scalar type.
                    834: 
                    835: erroneously permitted comma expressions in constant expressions.
                    836: 
                    837: erroneously permitted negative bit field widths.
                    838: 
                    839: did not recognize simple function types in casts, eg, int().
                    840: 
                    841: incorrectly used the type of x or y for c?x:y where c is a constant;
                    842: the correct type is the composite type of x and y; eg, the type of
                    843: 1?(char*)p:(const char*q) is const char* not char* .
                    844: 
                    845: `lcc -g foo.i' emitted incorrect line number information if foo.i
                    846: didn't include `# n file' directives.
                    847: 
                    848: -g did not emit line number information for initialized locals.
                    849: 
                    850: 7/9/90:
                    851: 
                    852: on the vax, lcc generated code that wouldn't even assemble for
                    853: char c;unsigned short *v;f(){c = v[c];}
                    854: 
                    855: 8/27/90:
                    856: 
                    857: -b produces code that writes an expression-level profile into
                    858: prof.out.  bprint turns the data into an annotated listing, and lcc
                    859: -Wf-a uses it to improve register assignments.  the man pages for lcc
                    860: and bprint elaborate.
                    861: 
                    862: warns about implicit returns for functions that return other than int
                    863: or void; -A includes int functions.
                    864: 
                    865: -E now preprocesses unsuffixed file arguments.
                    866: 
                    867: sign extends integer right shift in constant expressions on all targets.
                    868: 
                    869: many internal improvements, all theoretically invisible.
                    870: 
                    871: errors fixed:
                    872: 
                    873: -t caused an erroneous redeclaration message for printf.
                    874: 
                    875: failed to convert x from double to float in f(x) const/volatile float x; {...}
                    876: 
                    877: erroneously forbid const/volatile enum {...} x in switch (x) and in int y=x.
                    878: 
                    879: erroneously forbid enum bit fields for enum types that are compatible
                    880: with int, signed int, or unsigned.
                    881: 
                    882: variadic functions with structure arguments did not work; 1 and 2-byte
                    883: structs still fail on big endians (non-DEC MIPS, Motorola, SPARC), and
                    884: 8-byte structs and those holding doubles fail on all MIPSes.
                    885: 
                    886: with -g on V10 VAXes, bad symbol table names for anonymous structs,
                    887: unions, and enums.
                    888: 
                    889: with -g on the Sun (68020 & SPARC), bad symbol table entries for
                    890: mutually referential structs.
                    891: 
                    892: with -g, misplaced or omitted symbol table entries for statics,
                    893: externs, typedefs, and types defined in nested blocks.
                    894: 
                    895: assertion failure on illegal casts of constants, eg, (struct foo)0.
                    896: 
                    897: assertion failure on switch(x.y) {...} where y is an undefined field.
                    898: 
                    899: 8/28/90:
                    900: 
                    901: on the vax, an unsigned div/mod common subexpr that was also an
                    902: argument caused lcc to loop.  on the sparc, it happened for all
                    903: int/unsigned div/mod/mul operations.
                    904: 
                    905: 9/5/90:
                    906: 
                    907: now permits any number of parameters.
                    908: 
                    909: volatile locals and parameters are no longer assigned to registers.
                    910: 
                    911: with -g, parameters are no longer assigned to registers; some debuggers
                    912: couldn't cope.
                    913: 
                    914: generated bad symbolic addresses in constant expressions involving
                    915: externals declared inside blocks.
                    916: 
                    917: misdiagnosed as errors some multiple assignments of returned structs,
                    918: eg, struct p {...} f(); struct r {struct p c;} x,y; x.c = y.c = f();
                    919: 
                    920: on sparcs, generated unaligned code after some initialized const data.
                    921: 
                    922: 9/13/90:
                    923: 
                    924: erroneously elided calls to struct functions in conditional expressions
                    925: where the resulting value went unused, eg, i?y:f()
                    926: 
                    927: assertion failure on conditional expressions with calls to struct
                    928: functions, eg, x=i?y:f()
                    929: 
                    930: improved diagnostics.
                    931: 
                    932: theoretically invisible internal improvements.
                    933: 
                    934: 9/14/90:
                    935: 
                    936: lcc crashed on f(){const struct { int a; } *fp;fp++;}
                    937: 
                    938: 9/21/90:
                    939: 
                    940: dropped backslashes that appeared at positions evenly divided by 4096.
                    941: 
                    942: on v10 vaxes, now emits stab entries for locals even without -g,
                    943: for consistency with cc.
                    944: 
                    945: on sparcs, fixes bad code for some argument lists that perform
                    946: a mul/div/mod after the third argument.
                    947: 
                    948: 10/22/90:
                    949: 
                    950: improvements/changes:
                    951: warns about static declarations that specify incomplete types.
                    952: 
                    953: diagnoses declarations that specify objects with sizes >= 2^31.
                    954: 
                    955: detects overflow in constant expressions and treats such expressions
                    956: as non-constant expressions; compiling old code may fail.
                    957: 
                    958: better register allocation for leaf functions.  on sparcs, better
                    959: register allocation for all functions.
                    960: 
                    961: elides unreferenced locals.
                    962: 
                    963: warns about bit-field initializers that are too big.
                    964: 
                    965: with -N, duplicate global definitions in separately compiled
                    966: files cause loader errors; compiling old code may fail.
                    967: 
                    968: improved diagnostics.
                    969: 
                    970: errors fixed:
                    971: erroneously permitted static function declarations in blocks.
                    972: 
                    973: erroneously diagnosed valid multiple declarations within blocks.
                    974: 
                    975: computed incorrect composite types from multiple declarations.
                    976: 
                    977: with -g, the Sun assembler choked on long symbol table entries;
                    978: continuations are now emitted.
                    979: 
                    980: with -t, assertion failure on `return f(x)' where f returns a struct.
                    981: 
                    982: bad values for (unsigned)d when 2147483647 < double d <= 4294967295.
                    983: 
                    984: erroneously forbid carriage returns in strings.
                    985: 
                    986: 10/23/90:
                    987: 
                    988: fixes floating overflow in constant multiplications in which one
                    989: nonzero argument is between -1.0 and 1.0.
                    990: 
                    991: 11/28/90:
                    992: 
                    993: Now accepts #line.  It has for a month, but I forgot to say so before.
                    994: 
                    995: Now ignores multiple occurrences of just `.o' file arguments.
                    996: Formerly, it ignored multiple occurrences of ALL file arguments.
                    997: 
                    998: With -A, now warns about declarations and casts with prototype-less
                    999: function types.  Formerly, it warned only at calls.
                   1000: 
                   1001: Warns about casts from pointers to integral types that are too small.
                   1002: 
                   1003: Overflow in constant exprs has been demoted from an error to a warning.
                   1004: 
                   1005: Conversions between pointers to objects and pointers to functions are
                   1006: now properly diagnosed.
                   1007: 
                   1008: Void and struct operands to bitwise and, or and xor operators no longer
                   1009: cause an assertion failure.
                   1010: 
                   1011: With -t, an illegal void return value or argument no longer causes an
                   1012: assertion failure.
                   1013: 
                   1014: On MIPSes, functions with 3 or more float arguments no longer cause an
                   1015: assertion failure.
                   1016: 
                   1017: On Suns and V10 Vaxes, now detects overflow in float and double
                   1018: constants.  It is supposed to do so on all targets, but some of them
                   1019: have sub-standard strtod's.
                   1020: 
                   1021: On Suns, lcc now accepts the ld options -Bstatic and -Bdynamic.
                   1022: 
                   1023: On SPARCs, fixes bad code when passing structures followed by
                   1024: floats/doubles.
                   1025: 
                   1026: On SPARCs, -p and -pg now work.
                   1027: 
                   1028: On V10 VAXes, formals may now get assigned to registers.  An error
                   1029: introduced several months ago had been forcing them into the stack.
                   1030: 
                   1031: 12/6/90:
                   1032: 
                   1033: The compiler crashed after diagnosing some syntax errors involving
                   1034: top-level functions (eg, "void *a();static b(int)c(){}").
                   1035: 
                   1036: With -b, the execution count for e2 in "for(e1;e2;e3)S" was wrong for
                   1037: loops not guaranteed to execute at least once.
                   1038: 
                   1039: On the MIPS, the compiler crashed when frequently referenced locals
                   1040: were used in deeply nested loops.  The reference count estimate
                   1041: overflowed.
                   1042: 
                   1043: On the SPARC, fixes (again!) bad code when passing structures followed
                   1044: by floats/doubles.
                   1045: 
                   1046: On the SPARC, adds missing prototype to infinity() in math.h.
                   1047: 
                   1048: 12/13/90:
                   1049: 
                   1050: Since 10/26/90, -N has arranged loader diagnostics for duplicate global
                   1051: definitions in separately compiled modules.  The arrangement, however,
                   1052: placed uninitialized globals in the data segment, which made some .o
                   1053: files huge.  Such globals have now been shifted back to the bss
                   1054: segment, saving space without losing the loader diagnostics.  On the
                   1055: MIPS, discard old .o files created with -N;  they might be compatable
                   1056: with new ones, but only an ld expert could guarantee it.
                   1057: 
                   1058: [Without -N, uninitialized globals are emitted as "common" blocks, so
                   1059: loaders -- contrary to ANSI -- may silently merge duplicate
                   1060: definitions.  -N is overloaded: it also forbids extensions and searches
                   1061: for includes in only directories given by -I options.]
                   1062: 
                   1063: lcc crashed when unknown enum types were used in contexts that required
                   1064: their sizes.
                   1065: 
                   1066: lcc crashed or died with an assertion failure when parameter names were
                   1067: missing from new-style function definitions (eg, f(int){}).
                   1068: 
                   1069: bprint crashed when prof.out had data for functions with >200 execution
                   1070: point counters.
                   1071: 
                   1072: 12/21/90:
                   1073: 
                   1074: lcc issued an erroneous ``lvalue required'' diagnostic for x[0]=f()
                   1075: when f returns a struct.
                   1076: 
                   1077: 1/24/91:
                   1078: 
                   1079: now reports as errors identifiers longer than 64 characters when they
                   1080: may cause parsing errors (because they span input buffers).
                   1081: 
                   1082: erroneously forbid initialized local const arrays:
                   1083: f(){const char msg[]="hi";}
                   1084: 
                   1085: erroneously warned about missing return values for:
                   1086: const void f(){}
                   1087: volatile void f(){}
                   1088: 
                   1089: erroneously permitted function definitions with invalid uses of void
                   1090: arguments, some of which caused the compiler to crash:
                   1091: f(void,...){}
                   1092: g(void, int){}
                   1093: h(void, void){}
                   1094: 
                   1095: aborted with an assertion failure on casts of a return value to void:
                   1096: void f(){return(void)23;}
                   1097: 
                   1098: crashed when printing warnings about unreferenced const volatile statics.
                   1099: 
                   1100: [I can't reach the Sun-3's or quetzal now.  I'll update these machines
                   1101: later.]
                   1102: 
                   1103: 2/14/91:
                   1104: 
                   1105: Misidentified characters with ASCII codes greater than 127.
                   1106: 
                   1107: switch(x) where x is a struct or union caused an assertion failure.
                   1108: 
                   1109: On the vax, silently generated bad code for
                   1110: *<expr with ++ or --> = <expr with unsigned div/mod>
                   1111: (This was fixed last time, but I forgot to announce it.)
                   1112: 
                   1113: On the vax, does a better job of using two-operand instructions (eg,
                   1114: addl2) and deleting gratuitous tst instructions.
                   1115: 
                   1116: The warnings have been regularized somewhat.  Use "-A -A" to flag
                   1117: missing prototypes and as many undefined behaviors as possible; use
                   1118: "-A" to flag little more than missing prototypes; use no -A options for
                   1119: relative quiet.
                   1120: 
                   1121: with -A, warns about:
                   1122:    missing prototypes in function types
                   1123:    missing return value in a return from an int function
                   1124:   *assignments between pointers to ints and pointers to enumerations
                   1125:   *conversions from pointers to smaller integral types
                   1126: 
                   1127: a second -A also warns about:
                   1128:    non-ANSI language extensions
                   1129:    non-ANSI source characters in character and string literals
                   1130:   *unrecognized control lines
                   1131:   *unreferenced variables and static functions
                   1132:   *more than 32kb in an array, struct, or union
                   1133:    more than 509 characters in a string literal
                   1134:    more than 127 case labels in a switch statement
                   1135:    more than 31 formal parameters
                   1136:    more than 15 levels of nested statements
                   1137:    more than 127 identifiers declared in a block
                   1138:    more than 511 external identifiers
                   1139:    more than 127 fields in a struct or union
                   1140:    more than 127 enumeration constants in an enumeration
                   1141: 
                   1142: * marks those warnings that were given *without* -A previously.
                   1143: 
                   1144: Formerly, -N cleared the #include search list, disabled language
                   1145: extensions, and arranged for duplicate global definitions in separately
                   1146: compiled files to cause loader errors.  It now fools only with
                   1147: #includes;  -A -A handles the others.
                   1148: 
                   1149: [I can't reach the Sun-4's now.  I'll update them later.]
                   1150: 
                   1151: 5/4/91:
                   1152: 
                   1153: -A -A now warns about using function designators in conditionals
                   1154: (eg, f(){int g();if(g);})
                   1155: 
                   1156: Null characters in string and character literals are now accepted.
                   1157: 
                   1158: Returning the address of a parameter or a local is now an error.
                   1159: 
                   1160: The compiler proper no longer ignores \<newline> in string and
                   1161: character literals; `line splicing' must be done by preprocessors.
                   1162: 
                   1163: Erroneously complained about some valid uses of function types,
                   1164: (eg, int f(int (int));)
                   1165: 
                   1166: Using -b to append data to a prof.out compressed by bprint -c corrupted
                   1167: the execution counts.
                   1168: 
                   1169: Erroneously complained about a typedef name used as a label at the
                   1170: first token in a compound statement (eg, typedef int T; f(){T:;})
                   1171: 
                   1172: Erroneously permitted array fields of structs returned by functions to
                   1173: be passed as arguments (eg, struct foo {char s[63];} g(); f(g().s);)
                   1174: 
                   1175: Subsequent definition of unknown enums caused an assertion failure,
                   1176: (eg, enum foo x; enum foo {a,b,c};)
                   1177: 
                   1178: Failed to diagnose empty extern/static declarations of enums or
                   1179: structs (eg, extern enum foo {a};)
                   1180: 
                   1181: Failed to ignore leading white space that spanned input buffers.
                   1182: 
                   1183: Failed to promote case labels to the promoted type of the switch
                   1184: expression (eg, case (char)16.2:).
                   1185: 
                   1186: In structs/unions without named bit fields, padding specified by
                   1187: unnamed bit fields was erroneously omitted in initializations. (eg,
                   1188: struct { char a; int:0; char b; } x = {'a','b'} misinitialized x.b.)
                   1189: 
                   1190: Erroneously complained about extern declarations of sizeless arrays
                   1191: with block scope that referred to statics with file scope (eg, static
                   1192: int a[3]; f() { extern int a[]; ...})
                   1193: 
                   1194: On the MIPS, better code for conversions from char/short to unsigned.
                   1195: 
                   1196: On the MIPS, failed to detect overflow in (1<<31)[*/](-1) and crashed.
                   1197: 
                   1198: On the SPARC, taking the address of an argument in leaf functions
                   1199: caused junk to be stored in the actual argument, eg, f(x){int *p = &x;}
                   1200: 
                   1201: On the SPARC, stdlib.h erroneously defined toupper() and tolower() as
                   1202: macros; they're library functions.
                   1203: 
                   1204: On the SPARC, RAND_MAX in stdlib.h was erroneously defined as 32767; it
                   1205: should be 2^31-1.
                   1206: 
                   1207: On Suns, -target sun[34] is now recognized (and ignored).
                   1208: 
                   1209: 8/2/91:
                   1210: 
                   1211: Now permits -o to name the output file for -c and -S when
                   1212: invoked with exactly one source file.
                   1213: 
                   1214: -t now prints char*'s as a address in hex and as a string.
                   1215: 
                   1216: Constants cast to const/volatile were not treated as constant operands
                   1217: (eg, (const int)23 + 80 was not accepted as a constant expression).
                   1218: 
                   1219: Some generated labels were not of the form Ln, which clogged symbol
                   1220: tables and confused profilers on some targets.
                   1221: 
                   1222: The declaration `struct S;' failed to introduce a new type when a
                   1223: struct S was defined in an enclosing scope.
                   1224: 
                   1225: When built with a compiler where `char' is unsigned, lcc failed to
                   1226: sign-extend `signed char' in constant expressions (eg, (signed char)-4
                   1227: became 252 instead of -4.)
                   1228: 
                   1229: In structs/unions with bit fields, intra-word padding specified by
                   1230: unnamed bit fields was erroneously omitted in initializations (eg,
                   1231: struct {int :8;int a:3;}x={1} initialized x.a to 0 instead of 1).
                   1232: 
                   1233: Crashed when case labels were given outside of switches.
                   1234: 
                   1235: Sometimes computed incorrect values for relationals over two floating
                   1236: point constants.
                   1237: 
                   1238: Erroneously permitted old-style parameter lists in function
                   1239: delarators.  Some caused the compiler to crash, eg,
                   1240: int(*f)(a);g(){(*f)(0);}
                   1241: 
                   1242: On the 68020, SPARC and VAX, -g emitted bad symbol table data for
                   1243: typedefs of const/volatile types.
                   1244: 
                   1245: On the 68020, lcc suffered an assertion failure occasionally when it
                   1246: ran out of floating point registers.
                   1247: 
                   1248: On the MIPS, now places constants in the read-only data segment instead
                   1249: of the text segment.
                   1250: 
                   1251: On the SPARC, now recognizes as leaves functions that return floats or
                   1252: doubles but use no other floating-point registers, eg, float f(float
                   1253: x){return x;}
                   1254: 
                   1255: On the SPARC, emitted bad code for leaf functions that took the address
                   1256: of a float/double argument.
                   1257: 
                   1258: 8/13/91:
                   1259: 
                   1260: Generated bad code for expressions with multiple references to fields
                   1261: of structs returned by functions (eg, f().a + g().b).
                   1262: 
                   1263: Erroneously diagnosed as errors valid function definitions in which
                   1264: old-style parameters appeared in a declarator nested in parens (eg, int
                   1265: (*f(a,b))() int a,b; {}).
                   1266: 
                   1267: 9/30/91:
                   1268: 
                   1269: "struct S;" is now never an error, even if repeated.
                   1270: 
                   1271: Fixed assertion failure when a comparison was used as a value in an
                   1272: expression that had a type error, like char*f(){int x;x=(x==1|f());}
                   1273: 
                   1274: -b profiled "while (e) S" wrong when e is constant and under -g.
                   1275: 
                   1276: -P failed to include "const" and "volatile" in its output declarations.
                   1277: 
                   1278: On the 68020, the driver now supplies -Dmc68000O in addition to
                   1279: -Dmc68000.
                   1280: 
                   1281: On the MIPS, -Wf-Gn specifies the maximum size for data placed in the
                   1282: "short data" segment ala cc(1); the default is 8, and 0 causes all data
                   1283: to be placed in the "data" segment. -Wa-Gn and -Wl-Gn pass similar
                   1284: flags to the assembler and linker, resp.
                   1285: 
                   1286: On the SPARC, structures are now passed using Sun's conventions.
                   1287: Discard old .o files.
                   1288: 
                   1289: If bprint sees that it's about to print a count INSIDE a number or
                   1290: identifier, it moves the count to just BEFORE the token.  This
                   1291: heuristic applies only when macros or comments have confused bprint
                   1292: about the source code.  (Thanks to Doug.)
                   1293: 
                   1294: 10/7/91:
                   1295: 
                   1296: On the SPARC, generated bad code for functions that are declared to
                   1297: return a struct but then fail to, like struct node f(){}.
                   1298: 
                   1299: -P failed to include "const" and "volatile" in its output declarations.
                   1300: 
                   1301: 1/4/92:
                   1302: 
                   1303: lcc formerly stopped compiling after 20 errors; -Wf-e<n> now sets the
                   1304: error limit to <n>.
                   1305: 
                   1306: The driver now checks for non-existent or unreadable .c or .i files and
                   1307: does not try to compile them.
                   1308: 
                   1309: Crashed when an unknown typedef declared parameters in old-style
                   1310: function definitions, like "f(x) T x; {...}".
                   1311: 
                   1312: Crashed when both -b and -n were specified.
                   1313: 
                   1314: Failed to fold case labels that exceeded the limits of the type of the
                   1315: associated switch expression, like "int i; switch (i) {case0xeb010000:;}".
                   1316: This yielded bad duplicate case label diagnostics or incorrect code.
                   1317: 
                   1318: Failed to recognize unsigned comparisons with zero as constant expressions.
                   1319: For example, "int i=5U>=0;" is now accepted.
                   1320: 
                   1321: Failed to diagnose structure initializations with excess initializers,
                   1322: like "struct { int a,b; } x = { 1,2,3 };".
                   1323: 
                   1324: Failed to count as references occurrences of identifiers in asm, so
                   1325: locals with no other references were erroneously deleted.
                   1326: 
                   1327: Failed to make each parameter visible at the end of its declarator,
                   1328: which led to erroneous diagnostics for valid prototypes.  For example,
                   1329: "f(int a, int b[sizeof a])" is now accepted.
                   1330: 
                   1331: errno.h defined more error codes than are specified by the standard; it
                   1332: now defines only EDOM and ERANGE.
                   1333: 
                   1334: assert.h, errno.h, locale.h, stdio.h, stdlib.h, string.h, and time.h
                   1335: included other headers and thus defined symbols beyond those permitted
                   1336: by the standard.  They now define only the specified symbols, except for
                   1337: assert.h, which defines write, sprintf, and abort on some targets.
                   1338: 
                   1339: On the MIPS and SPARC, better code for structure assignment and
                   1340: structure arguments.
                   1341: 
                   1342: On the SPARC with -g, gdb and dbx printed incorrect values for parameters
                   1343: that were changed because of extraneous symbol table entries.
                   1344: 
                   1345: On the MIPS with -g, gdb and dbx mislocated some source files when
                   1346: #include directions contained function and variable definitions.
                   1347: 
                   1348: 2/11/92:
                   1349: 
                   1350: Erroneously identified T* as the offending type when sizeof(T) is
                   1351: unknown or 0 (eg, "void *a,*b;a-b;").  Now correctly fingers T
                   1352: instead.
                   1353: 
                   1354: Erroneously allowed arithmetic on `void *const' pointers (eg,
                   1355: "void *const p; int i; p+i;").
                   1356: 
                   1357: Crashed when comparing prototypes with an argument that is a pointer to
                   1358: a function with a prototype, like
                   1359: int (*g)(char *,...); void f(int (*)(char *,...)) {} ... f(g);
                   1360: 
                   1361: On Suns and BSD VAXes, ctype.h defined static functions _tolower and
                   1362: _toupper, which prompted `unreferenced' warnings if they weren't used.
                   1363: 
                   1364: 4/13/92:
                   1365: 
                   1366: Crashed when comparing prototypes that differ in only top-level
                   1367: qualifiers (eg, int f(int); int f(const int);)
                   1368: 
                   1369: The driver no longer ignores extra characters after flags.  As always,
                   1370: unrecognized flags are sent to the linker; eg, -cg was formerly treated
                   1371: like -c, but it's now sent to ld, which will complain.
                   1372: 
                   1373: Now recognizes the identity u/1U == u for unsigned u.
                   1374: 
                   1375: -A -A now correctly complains about switch statements with more than
                   1376: 257 cases instead of 127.
                   1377: 
                   1378: On the SPARC, generated incorrect code for calls with a floating-point
                   1379: argument followed anywhere by an argument involving an integer or
                   1380: unsigned division, multiplication, or modulus (eg, int i,j; f() {
                   1381: f(1.0,i/j); })
                   1382: 
                   1383: On the SPARC, generated invalid assembly code for assignments of
                   1384: structures over 4095 bytes.
                   1385: 
                   1386: 12/16/92:
                   1387: 
                   1388: changes/improvements:
                   1389: with -d0, warns about switch statements with huge jump tables, eg,
                   1390: switch (i) { case INT_MAX: ...; case INT_MIN: ... }
                   1391: 
                   1392: now accepts identifiers up to 4096 characters long, although the ANSI
                   1393: standard requires that only the first 31 be examined.
                   1394: 
                   1395: returning a pointer to a local variable now elicits a warning
                   1396: instead of an error.
                   1397: 
                   1398: now warns about eliding references to incomplete types, eg,
                   1399: void *x; *x;
                   1400: 
                   1401: with -A -A, now warns when declaring arrays incomplete types,
                   1402: eg, extern struct s x[];
                   1403: 
                   1404: offsetof is less machine-specific but equivalent to the old one.
                   1405: 
                   1406: On the MIPS, uses fewer of the assembler's pseudo-ops.  The assembly
                   1407: code looks longer, but it should generate about the same machine code.
                   1408: 
                   1409: On the MIPS, a few stack frames may be larger, to enforce stricter
                   1410: alignment for the R4000.
                   1411: 
                   1412: errors fixed:
                   1413: with -n, failed to recognize expressions that dereferenced constant
                   1414: pointers as valid constant expressions, eg,
                   1415: struct foo { int a, b; };
                   1416: unsigned off = (char *)&((struct foo *)0)->b - (char *)0;
                   1417: 
                   1418: generated bad code for some inputs for which the compiler needed
                   1419: numerous temporaries.
                   1420: 
                   1421: failed to accept function definitions with multiple top-level
                   1422: prototypes, eg, int (*g(int c))(char) { c = 0; }
                   1423: 
                   1424: failed to warn about overflow in enumeration values, eg,
                   1425: enum { X = ~0U };
                   1426: 
                   1427: ignored trailing characters of long file names in some "#" lines, which
                   1428: caused erroneous diagnostics. now accepts names upto 512 characters, and
                   1429: warns about longer ones.
                   1430: 
                   1431: erroneously made enumerations visible before their optional values, eg,
                   1432: enum{A=2}; f() { enum {A=A} i = A; } assigned 0 to i instead of 2.
                   1433: 
                   1434: exited with a code of 0 instead of 1 when there was exactly one
                   1435: "found X expecting Y" diagnostic.
                   1436: 
                   1437: failed to detect overflow in hex character constants, eg, '\x100000000'.
                   1438: 
                   1439: failed to accept assignment of 0U to pointers.
                   1440: 
                   1441: failed to associate tags defined in a parameter list with defining
                   1442: declarations inside a function, eg,
                   1443: f(struct S *s) { struct S { int a; }; s->a = 1; }
                   1444: 
                   1445: failed to reject function definitions with storage class typedef.
                   1446: 
                   1447: failed to accept a trailing `,' in initializers for scalars
                   1448: and unions, eg, int x = {1,};
                   1449: 
                   1450: erroneously defined wchar_t as `char' instead of `unsigned char';
                   1451: L'\xff' must have the integer value 0xff.
                   1452: 
                   1453: failed to reject type `array of void'.
                   1454: 
                   1455: failed to reject comparing a pointer to an object type
                   1456: with a pointer to an incomplete type, eg,
                   1457: extern int (*a)[],(*b)[10]; ...; if (a == b) ...
                   1458: 
                   1459: failed to warn about comparing a function pointer with a void*,
                   1460: eg, int (*fp)(); ... if (fp == (void *)0) ...
                   1461: 
                   1462: failed to reject (..., 0) as a null pointer constant.
                   1463: 
                   1464: failed to accept redeclaration of functions with differently
                   1465: qualified parameters, eg, f(int); f(const int);
                   1466: 
                   1467: on the SPARC, under -b, exit() failed to close all open files.
                   1468: 
                   1469: on the MIPS, generated bad code for calls to variadic functions
                   1470: with a leading floating point arg (eg, f(double x,...)) when
                   1471: the 2nd actual argument was a float or a double.
                   1472: 
                   1473: 12/17/92:
                   1474: 
                   1475: fix bug introduced yesterday into stddef.h's offsetof macro.
                   1476: 
                   1477: 12/18/92:
                   1478: 
                   1479: On the MIPS, fixes code generated since 12/16 that crashes most
                   1480: procedures with >32kb of locals.
                   1481: 
                   1482: 2/18/93:
                   1483: 
                   1484: On the MIPS, silently generated incorrect code for some programs that
                   1485: mix (single-precision) float register variables with int conditional
                   1486: exprs or int register variables with float conditional exprs.
                   1487: 
                   1488: next:
                   1489: 
                   1490: all enums are now ints; old .o files that use enums are incompatible
                   1491: with new ones.
                   1492: 
                   1493: asm("...") is gone.
                   1494: 
                   1495: Erroneously treated the constant -0.0 as 0.0, which IEEE forbids.
                   1496: 
                   1497: Erroneously diagnosed tentative unsized array definitions, eg,
                   1498: a lone "int x[]" is treated as "int x[]={0}"

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.