[Click] Suspicious warnings in Click Git

Eddie Kohler kohler at cs.ucla.edu
Sun Nov 9 13:39:22 EST 2008


Hi Bart,

Thanks for this note.  I think that on 32-bit machines, recent gccs do not 
warn about translating -1 to a uint32_t.  But on some 64-bit machines perhaps 
they warn about the truncation.  I checked in some explicit casts.

Eddie


Bart Braem wrote:
> Hi list,
> 
> While compiling the git head I got these warnings:
> 
>    CXX ../lib/routerthread.cc
> ../lib/routerthread.cc: In member function ‘void  
> RouterThread::driver_lock_tasks()’:
> ../lib/routerthread.cc:154: warning: passing negative value  
> ‘-0x00000000000000001’ for argument 2 to ‘bool  
> atomic_uint32_t::compare_and_swap(uint32_t, uint32_t)’
> ../lib/routerthread.cc: In member function ‘void  
> RouterThread::driver_unlock_tasks()’:
> ../lib/routerthread.cc:161: warning: passing negative value  
> ‘-0x00000000000000001’ for argument 1 to ‘bool  
> atomic_uint32_t::compare_and_swap(uint32_t, uint32_t)’
> 
> The code is somewhat strange, is this official syntax to call those  
> functions with negative arguments?
> 
> Regards,
> Bart Braem




More information about the click mailing list