Citeren Kjell Claesson <[email protected]>:
I ran into a portability issue with drivers/bcmxcp.c in nut-2.4.1 on
my UnixWare 7.1.4 machine. The error I get is
.....
UX:acomp: ERROR: "/opt/src/utils/nut-2.4.1/drivers/bcmxcp.c", line 835:
integral constant expression expected .....
Looking at the code we see
.....
int init_outlet(unsigned char len)
{
unsigned char answer[len];
.....
I agree with Tim, the above indeed isn't portable.
Although gcc can handle it, it's not portable C code.
What size should the answer array be?
It depends on the ups.
If the size of the answer isn't known at compile time, you should
either allocate it dynamically with malloc() or calloc() (at runtime)
or hardcode the size so big that any reply should fit in it.
Best regards, Arjen
--
Please keep list traffic on the list
_______________________________________________
Nut-upsdev mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev