Subject: Re: Question regarding C syntax
To: Georg Schwarz <georg.schwarz@freenet.de>
From: Hubert Feyrer <hubert@feyrer.de>
List: tech-pkg
Date: 09/16/2006 23:11:13
On Sat, 16 Sep 2006, Georg Schwarz wrote:
> static Package pkg_config_package = {
> .key = PACKAGE,
...
> This code does not compile with the IRIX IDO cc (other non-gcc compilers
> might also be affected).
> Is it OK to change it into the following form?
Probably.
The syntax above is not in c89 ("ansi c"), but it's part of c99.
If you have a C99 compiler available, try using that.
You can test this with gcc, too:
miyu% gcc -pedantic -std=c89 s.c -o s
s.c: In function 'main':
s.c:11: warning: ISO C90 forbids specifying subobject to initialize
s.c:12: warning: ISO C90 forbids specifying subobject to initialize
s.c:13: warning: ISO C90 forbids specifying subobject to initialize
miyu% gcc -pedantic -std=c99 s.c -o s
miyu%
- Hubert