[protobuf] usage of 'null' as a variable name in protobuf-2.5.0

2013-05-20 Thread daniel . ng1234
Version 2.5.0 has the following line in a couple of places in 
repeated_field.h:

MessageLite* null = NULL;


My gnu-based compiler doesn't like this as it thinks 'null' is a constant.

If I rename 'null' as 'narl' then it's OK.

Is 'null' a valid variable name?

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [protobuf] usage of 'null' as a variable name in protobuf-2.5.0

2013-05-20 Thread Feng Xiao
On Thu, May 16, 2013 at 10:58 PM, daniel.ng1...@gmail.com wrote:

 Version 2.5.0 has the following line in a couple of places in
 repeated_field.h:

 MessageLite* null = NULL;


 My gnu-based compiler doesn't like this as it thinks 'null' is a constant.

 If I rename 'null' as 'narl' then it's OK.

 Is 'null' a valid variable name?

I believe it is. You are probably using some library which defines null as
a macro.




  --
 You received this message because you are subscribed to the Google Groups
 Protocol Buffers group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to protobuf+unsubscr...@googlegroups.com.
 To post to this group, send email to protobuf@googlegroups.com.
 Visit this group at http://groups.google.com/group/protobuf?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [protobuf] usage of 'null' as a variable name in protobuf-2.5.0

2013-05-20 Thread Henner Zeller
On 20 May 2013 09:55, Feng Xiao xiaof...@google.com wrote:




 On Thu, May 16, 2013 at 10:58 PM, daniel.ng1...@gmail.com wrote:

 Version 2.5.0 has the following line in a couple of places in
 repeated_field.h:

 MessageLite* null = NULL;


 My gnu-based compiler doesn't like this as it thinks 'null' is a constant.

 If I rename 'null' as 'narl' then it's OK.

 Is 'null' a valid variable name?

 I believe it is. You are probably using some library which defines null as
 a macro.


Still, it might not be a good idea to use such a name. I could imagine
translating this proto buffer into other languages might create trouble.

-h






  --
 You received this message because you are subscribed to the Google Groups
 Protocol Buffers group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to protobuf+unsubscr...@googlegroups.com.
 To post to this group, send email to protobuf@googlegroups.com.
 Visit this group at http://groups.google.com/group/protobuf?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 You received this message because you are subscribed to the Google Groups
 Protocol Buffers group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to protobuf+unsubscr...@googlegroups.com.
 To post to this group, send email to protobuf@googlegroups.com.
 Visit this group at http://groups.google.com/group/protobuf?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.