On 04/07/2010 10:17 PM, Jose-Marcio Martins da Cruz wrote:
> 
> Sun Studio Compiler finds two buglets in 0.96.
> 
> **********************************
> 
>   CC     bcrun.o
> "bcrun.c", line 240: warning: initializer does not fit or is out of
> range: -1
> 
> Line 240 is :
> 
>     unsigned int fd = -1;
> 
> An unsigned integer can't be negative. Should delete the word "unsigned".

Right, it should be an int.

> 
> **********************************
> 
> Many lines of :
> "../libclamav/bytecode_api.h", line 55: warning: enumerator value
> overflows INT_MAX (2147483647)
> 
> enum { PE_INVALID_RVA = 0xFFFFFFFF };
> 
> Well, enum types aren't necessarily unsigned (as long as I know), but as
> long as clamav shall be 64 bits compatible, IMHO, it should be better to
> write something of the kind :
> 
> enum { PE_INVALID_RVA = UINT_MAX };
> 
> instead of hardcode this value, unless the exact value cares.

The exact value matters: it is used by the bytecode, and this value is
part of the bytecode <-> libclamav API.
However I could use an (unsigned) integer constant instead of the enum.

Best regards,
--Edwin
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

Reply via email to