[Nut-upsdev] building on Solaris 10 (was Re: 2.4.2 freeze)

Tim Rice tim at multitalents.net
Tue Feb 16 19:27:16 UTC 2010


On Tue, 16 Feb 2010, Arjen de Korte wrote:

> Citeren Tim Rice <tim at multitalents.net>:
> > Of those, all but 5 were the "too many struct/union initializers" warnings.
> 
> Could you try if hardcoding the length of the subdrv_info array, fixes these
> warnings?
> 
> --- E:/nut/trunk/drivers/main.h	(revision 2349)
> +++ E:/nut/trunk/drivers/main.h	(working copy)
> -	struct upsdrv_info_s	*subdrv_info[];	/* sub driver information */
> +	struct upsdrv_info_s	*subdrv_info[2];	/* sub driver

This does get rid of the warnings

> Most likely, your compiler doesn't like the use of variable length arrays
> (which were introduced in C99). We can fix that later if this proves to be the
> problem (although it can be useful at times, I don't like the use here
> either).

Strange, Sun's compiler (Sun Studio 12) claims to handle C99
......
   If you do not specify -xc99, the compiler defaults to
   -xc99=all,no_lib.

   [no]_lib       [Do not] Enable the 1999 C standard
                  library semantics of routines that
                  appeared in both the 1990 and 1999 C
                  standard.

   all            Turn on recognition of supported C99
                  language features and enable the 1999 C
                  standard library semantics of routines
                  that appear in both the 1990 and 1999 C
                  standard.
......
> 
> > What is left are these.
> > "/opt/src/utils/nut-2.4.1-r2349/drivers/upscode2.c", line 138: warning:
> > integer overflow detected: op "<<"
> 
> That was stupid, I should have known that. The mask bits in a bit field must
> be unsigned. Fixed in r2350.

Confirmed.
 

-- 
Tim Rice				Multitalents	(707) 887-1469
tim at multitalents.net





More information about the Nut-upsdev mailing list