[Nut-upsdev] Re: [nut-commits] svn commit r414 - in trunk: . drivers

Arjen de Korte nut+devel at de-korte.org
Wed Apr 26 14:56:10 UTC 2006


Niels Baggesen schreef:

> On Tue, Apr 25, 2006 at 04:36:03PM +0200, Arjen de Korte wrote:
>>> There are no other instances like this.
>> Yes there are, quite a few actually. Take for instance
>> 'drivers/mge-shut.c', in the function 'char_read' where the variable 'now'
>> is defined:
>>
>> 	if (FD_ISSET (upsfd, &readfs)) {
>> 		int now = read (upsfd, bytes, size - readen);
> 
> This is not the same. This int declaration is at the top of a block, and
> that has always been valid C.

I stand corrected, you're right.

> The cpsups instance IS (was) the only one,
> and it was introduced just a couple of weeks ago.

I did that in an attempt to fix compilation errors with yet another
compiler. Arnaud also warned me about this, by the way. I'll probably
redo this again, since I don't like the present situation either.

> I routinely compile with gcc2, gcc3 and gcc4 just to catch the largest
> share of problems.

Apparently, it does. Yet I would prefer a more documented way of
handling this. For instance, by adhering to a certain C standard. At the
moment, as far as I can see we are not compliant to *any* version of the
standard (K&R, ANSI, C90 or C99).

> And there are stricter compilers than gcc!

That's also one of my worries here and initially also the reason for
submitting the first patch. We may not catch all problems there may be,
although every one found helps.

Arjen



More information about the Nut-upsdev mailing list