Can someone tell me what this is suppose to accomplish and
why it causes a GCC seg fault. I pulled this code from a program
I was trying to compile under Linux
----- Begin -----
#define CREAD 1
#define CLOCAL 2
#define CS8 3
#define NCCS 10
#define B2400 12
#define NULL 0
#define QUEUE_SIZE 50
/*
* Actual UPS pre-initialized handler with reasonable defaults.
* The initialization is *very* GNU CC specific. Sigh.
*/
static struct ups ups = {
NULL, /* model */
{NULL, 0, {0, 0}, /* port */
{0, 0, 0, 0, {[0 ... NCCS-1] = 0},
0, 0}, /* otty */
{0, 0, CS8 | CREAD | CLOCAL,
0, {[0 ... NCCS-1] = 0},
B2400, B2400}, /* ntty */
1, {0, 0}, /* block size and delay */
{QUEUE_SIZE, NULL, NULL, NULL}}, /* queue */
NULL /* events */
----- End -----Quote:};
Script started on Mon Jul 29 20:48:13 1996
bmw:~/upsd-2.0> gcc -O -I../include -Wall -c uspd.new.c
uspd.new.c:16: variable `ups' has initializer but incomplete type
uspd.new.c:17: warning: excess elements in struct initializer after `ups'
uspd.new.c:18: extra brace group at end of initializer for `ups'
uspd.new.c:18: extra brace group at end of initializer for `ups'
uspd.new.c:19: extra brace group at end of initializer for `ups'
uspd.new.c:19: extra brace group at end of initializer for `ups'
gcc: Internal compiler error: program cc1 got fatal signal 11
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bmw:~/upsd-2.0> gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.2/specs
gcc version 2.7.2
bmw:~/upsd-2.0> uname -a
Linux bmw.autobahn.org 2.0.10 #4 Mon Jul 29 16:06:58 PDT 1996 i586
bmw:~/upsd-2.0> exit
exit
Script done on Mon Jul 29 20:48:31 1996
Take care,
-- Nick Kralevich