From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078619210604.tru64-unix-managers.marc@archive.invalid> From: LBRO Date: Fri, 21 Nov 1997 13:44:37 +0000 To: tru64-unix-managers Subject: C compiler problem X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078619210604 Hi, All other C compilers that I know of agree that n is a constant when declared const. However, DEC C V5.2 says it is not. The following alternatives are possible: 1. It is an error that I have to report to Digital. 2. It is optional and some obscure switch setting will make cc accept the code. 3. It conforms to ANSI standard (and everybody else are sloppy having n be a constant-expression when declared const int n = 7). # cat p.c main() { const int n = 10; char s[n]; } # cc -c p.c cc: Error: p.c, line 4: In the declaration of "s", "n" is not constant, but occurs in a context that requires a constant expression. char s[n]; ---------------^ # Yours, Lars Bro (lbro@dscc.dk)