Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Problem with has_bits on 64 bit Windows only
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jim Hunziker  
View profile  
 More options Feb 17 2012, 10:17 am
From: Jim Hunziker <landt...@gmail.com>
Date: Fri, 17 Feb 2012 07:17:26 -0800 (PST)
Local: Fri, Feb 17 2012 10:17 am
Subject: Problem with has_bits on 64 bit Windows only
I'm compiling a .proto file in both 64 bit windows and in 64 bit linux
(with version 2.4.1 of protobuf). The resulting .pb.h file is fine in
Linux, but the Windows 7 X64 version is very broken with respect to
has_bits. The problem only occurs when two bytes of has_bits are
required for tags.

.proto file:

message Foo {
  required int32 a1 = 1;
  required int32 a2 = 2;
  required int32 a3 = 3;
  required int32 a4 = 4;
  required int32 a5 = 5;
  required int32 a6 = 6;
  required int32 a7 = 7;
  required int32 a8 = 8;
  required int32 a9 = 9;
  required int32 a10 = 10;
  required int32 a11 = 11;
  required int32 a12 = 12;
  required int32 a13 = 13;
  required int32 a14 = 14;
  required int32 a15 = 15;
  required int32 a16 = 16;
  required int32 a17 = 17;
  required int32 a18 = 18;
  required int32 a19 = 19;
  required int32 a20 = 20;
  required int32 a21 = 21;
  required int32 a22 = 22;
  required int32 a23 = 23;
  required int32 a24 = 24;
  required int32 a25 = 25;
  required int32 a26 = 26;
  required int32 a27 = 27;
  required int32 a28 = 28;
  required int32 a29 = 29;
  required int32 a31 = 31;
  required int32 a32 = 32;
  required int32 a33 = 33;
  required int32 a34 = 34;

}

relevant part of test.pb.h in Linux (looks correct):

// required int32 a24 = 24;
inline bool Foo::has_a24() const {
  return (_has_bits_[0] & 0x00800000u) != 0;

}

inline void Foo::set_has_a24() {
  _has_bits_[0] |= 0x00800000u;
}

inline void Foo::clear_has_a24() {
  _has_bits_[0] &= ~0x00800000u;
}

inline void Foo::clear_a24() {
  a24_ = 0;
  clear_has_a24();
}

inline ::google::protobuf::int32 Foo::a24() const {
  return a24_;
}

inline void Foo::set_a24(::google::protobuf::int32 value) {
  set_has_a24();
  a24_ = value;

}

// required int32 a25 = 25;
inline bool Foo::has_a25() const {
  return (_has_bits_[0] & 0x01000000u) != 0;
}

inline void Foo::set_has_a25() {
  _has_bits_[0] |= 0x01000000u;
}

inline void Foo::clear_has_a25() {
  _has_bits_[0] &= ~0x01000000u;
}

inline void Foo::clear_a25() {
  a25_ = 0;
  clear_has_a25();
}

inline ::google::protobuf::int32 Foo::a25() const {
  return a25_;
}

inline void Foo::set_a25(::google::protobuf::int32 value) {
  set_has_a25();
  a25_ = value;

}

relevant part of test.pb.h in Windows 7 X64 (broken! look at the masks
for a25):

// required int32 a24 = 24;
inline bool Foo::has_a24() const {
  return (_has_bits_[0] & 0x00800000u) != 0;

}

inline void Foo::set_has_a24() {
  _has_bits_[0] |= 0x00800000u;
}

inline void Foo::clear_has_a24() {
  _has_bits_[0] &= ~0x00800000u;
}

inline void Foo::clear_a24() {
  a24_ = 0;
  clear_has_a24();
}

inline ::google::protobuf::int32 Foo::a24() const {
  return a24_;
}

inline void Foo::set_a24(::google::protobuf::int32 value) {
  set_has_a24();
  a24_ = value;

}

// required int32 a25 = 25;
inline bool Foo::has_a25() const {
  return (_has_bits_[0] & 0x11000000u) != 0;
}

inline void Foo::set_has_a25() {
  _has_bits_[0] |= 0x11000000u;
}

inline void Foo::clear_has_a25() {
  _has_bits_[0] &= ~0x11000000u;
}

inline void Foo::clear_a25() {
  a25_ = 0;
  clear_has_a25();
}

inline ::google::protobuf::int32 Foo::a25() const {
  return a25_;
}

inline void Foo::set_a25(::google::protobuf::int32 value) {
  set_has_a25();
  a25_ = value;


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sjd  
View profile  
 More options Mar 12 2012, 1:45 am
From: sjd <sdonova...@gmail.com>
Date: Sun, 11 Mar 2012 22:45:49 -0700 (PDT)
Local: Mon, Mar 12 2012 1:45 am
Subject: Re: Problem with has_bits on 64 bit Windows only
I've seen this too.  Similar problem with has_bits, though I often
find that the (incorrectly generated) bit-mask is 0x00000000u.

Has anyone debugged this yet to determine the fix?

Regards,

Sean

On Feb 17, 8:17 am, Jim Hunziker <landt...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »