Flash Gordon wrote:
[snip]
Anyone have an old copy of lcc (as opposed to Jacob's compiler) that
they can test to see if this is a problem in the original compiler?
I believe Jacob once said that lcc-win is originally based on lcc-3.6;
which was released in 1996 and did not support `long long'.
lcc-4.2 (released in 2002?) is still C89, but recognizes `long long'
as a type (though it's just an alias for `long').
The major difference between lcc and lcc-win seems to be that whenever
lcc-win (based on other articles in this thread) warns about
multiple use of 'foo'
lcc (3.6 as well as 4.2) issues a hard error
invalid use of 'foo'
and does /not/ produce an object file.
With lcc-4.2, `[signed] long long [int]' and `unsigned long long [int]'
are recognized correctly in all variations.
Below is a test case with most of the constructs that appeared in this
thread so far, plus two more. Most of the diagnostics look similar to
what other posters have seen from lcc-win, with the two exceptions noted
above.
/* 1 */ /* begin foo.c */
/* 2 */ long long int ll_1;
/* 3 */ long int long ll_2;
/* 4 */ int long long ll_3;
/* 5 */
/* 6 */ double int di_1;
/* 7 */ int double di_2;
/* 8 */
/* 9 */ int int int iii;
/* 10 */ long signed long int lsli;
/* 11 */ signed long int long slil;
/* 12 */ signed long signed long slsl;
/* 13 */ signed int long signed long int silsli;
/* 14 */ long int long int lili;
/* 15 */ long int int long liil;
/* 16 */
/* 17 */ signed long int double v_1;
/* 18 */ int long signed double v_2;
/* 19 */
/* 20 */ static typedef int t_1;
/* 21 */ typedef static int t_2;
/* 22 */
/* 23 */ struct s union u { int foo; };
/* 24 */ union u struct s { int foo; };
/* 25 */
/* 29 */ main() { return 0; }
/* 30 */ /* end foo.c */
$ lcc-4.2 -A -A -c foo.c
foo.c:2: warning: `long long int' is a non-ANSI type
foo.c:3: warning: `long long int' is a non-ANSI type
foo.c:4: warning: `long long int' is a non-ANSI type
foo.c:6: invalid use of `int'
foo.c:7: invalid use of `double'
foo.c:9: invalid use of `int'
foo.c:9: invalid use of `int'
foo.c:10: warning: `long long int' is a non-ANSI type
foo.c:11: warning: `long long int' is a non-ANSI type
foo.c:12: invalid use of `signed'
foo.c:12: warning: `long long int' is a non-ANSI type
foo.c:13: invalid use of `signed'
foo.c:13: invalid use of `int'
foo.c:13: warning: `long long int' is a non-ANSI type
foo.c:14: invalid use of `int'
foo.c:14: warning: `long long int' is a non-ANSI type
foo.c:15: invalid use of `int'
foo.c:15: warning: `long long int' is a non-ANSI type
foo.c:17: invalid use of `double'
foo.c:17: invalid type specification
foo.c:18: invalid use of `double'
foo.c:18: invalid type specification
foo.c:20: invalid use of `typedef'
foo.c:21: invalid use of `static'
foo.c:23: invalid use of `union'
foo.c:24: invalid use of `struct'
foo.c:34: warning: old-style function definition for `main'
foo.c:34: warning: missing prototype for `main'
foo.c:34: warning: `int main()' is a non-ANSI definition
foo.c:21: warning: static `int t_2' is not referenced