[CRIU] [PATCH 9/9] protobuf: replace the constant 4294967295 with 0xFFFFFFFF in generated sources

Alexander Kartashov alekskartashov at parallels.com
Wed Jan 16 10:09:26 EST 2013


On 01/16/2013 06:07 PM, Andrew Vagin wrote:
> On Wed, Jan 16, 2013 at 01:27:09PM +0400, Alexander Kartashov wrote:
>> On 01/16/2013 01:24 PM, Andrew Vagin wrote:
>>> Looks ugly. Is it a bug in the protobuf library?
>> Yes, it seems to be. Or GCC is too pedantic :)
> Could you show a warning message from gcc?
>> -- 
>> Sincerely yours,
>> Alexander Kartashov
>>
>> Intern
>> Core team
>>
>> www.parallels.com
>>
>> Skype: aleksandr.kartashov
>> Email: alekskartashov at parallels.com
>>

This has already been discussed in the CRIU ARM support thread:

 > On 01/14/2013 01:46 PM, Pavel Emelyanov wrote:
 >>What is the warning?
 >
 >This is a snipped of the code generated for packet-sock.proto:
 >
 >void   packet_sock_entry__init
 >                     (PacketSockEntry         *message)
 >{
 >  static PacketSockEntry init_value = PACKET_SOCK_ENTRY__INIT;
 >  *message = init_value;
 >}
 >
 >The macro PACKET_SOCK_ENTRY__INIT is declared in the following way:
 >
 >#define PACKET_SOCK_ENTRY__INIT \
 > { PROTOBUF_C_MESSAGE_INIT (&packet_sock_entry__descriptor) \
 >    , 0, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0,NULL, 
0,4294967295, NULL, NULL }
 >
 >The compiler says the following when sees this:
 >
 >packet-sock.pb-c.c: In function 'packet_sock_entry__init':
 >packet-sock.pb-c.c:98:3: error: this decimal constant is unsigned only 
in ISO C90 [-Werror]
 >packet-sock.pb-c.c: At top level:
 >packet-sock.pb-c.c:318:1: error: this decimal constant is unsigned 
only in ISO C90 [-Werror]
 >
 >It seems it's better to fix protobuf so it doesn't generate such a 
code but I'm afraid
 >it will take to long to settle

-- 
Sincerely yours,
Alexander Kartashov

Intern
Core team

www.parallels.com

Skype: aleksandr.kartashov
Email: alekskartashov at parallels.com



More information about the CRIU mailing list