DEC C not K&R or ANSI?

From: Jon Brinkmann <jb_at_galileo.apo.nmsu.edu>
Date: Thu, 15 May 1997 10:46:44 -0600 (MDT)

I've tried the following test program:

#define N 10

void main()
{
        int a[N,N], i, j;

        for (i = 0; i < N; i++)
                for (j = 0; j < N; j++)
                        a[i, j] = N * i + j;
}

The compiler says:

% cc -o atest -g atest.c
/usr/lib/cmplrs/cc/cfe: Error: atest.c, line 6: Syntax Error
        int a[10,10], i, j;
        --------^

% lint atest.c
"atest.c", line 6: error: syntax error
"atest.c", line 10: warning: a undefined
"atest.c", line 10: error: illegal indirection
"atest.c", line 12: warning: main() returns random value to invocation environment

What's going on here?

Jon
---
Dr. Jon Brinkmann				Apache Point Observatory
Instrument Scientist				2001 Apache Point Road
Internet:	brinkmann_at_nmsu.edu		P.O. Box 59
URL:	http://www.apo.nmsu.edu/brinkmann/	Sunspot, NM 88349-0059
Received on Thu May 15 1997 - 19:05:04 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:36 NZDT