Skip to content

Fix gcc 4.1 build (#1035)#1913

Merged
TeBoring merged 3 commits intoprotocolbuffers:masterfrom
matthauck:fix-gcc-41
Mar 1, 2017
Merged

Fix gcc 4.1 build (#1035)#1913
TeBoring merged 3 commits intoprotocolbuffers:masterfrom
matthauck:fix-gcc-41

Conversation

@matthauck
Copy link
Copy Markdown
Contributor

No description provided.

@grpc-kokoro
Copy link
Copy Markdown

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok to test.

@googlebot
Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@matthauck
Copy link
Copy Markdown
Contributor Author

This should fix #1035

@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

@matthauck
Copy link
Copy Markdown
Contributor Author

ping

Is there anything missing here? Any changes requested?

@bazel-io
Copy link
Copy Markdown

bazel-io commented Mar 1, 2017

Can one of the admins verify this patch?

@grpc-kokoro
Copy link
Copy Markdown

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@TeBoring
Copy link
Copy Markdown
Contributor

TeBoring commented Mar 1, 2017

Can you rebase this pull request on the current master?

@matthauck
Copy link
Copy Markdown
Contributor Author

Just finished doing that and making sure it still built. :)

@TeBoring
Copy link
Copy Markdown
Contributor

TeBoring commented Mar 1, 2017

ok to test.

@TeBoring
Copy link
Copy Markdown
Contributor

TeBoring commented Mar 1, 2017

LGTM

@TeBoring TeBoring merged commit 6011d7c into protocolbuffers:master Mar 1, 2017
@matthauck matthauck deleted the fix-gcc-41 branch March 1, 2017 19:17
Comment thread src/google/protobuf/map.h
#else
case google::protobuf::FieldDescriptor::CPPTYPE_INT64:
case google::protobuf::FieldDescriptor::CPPTYPE_UINT64:
GOOGLE_LOG(FATAL) << "Unsupported on this platform.";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the right use of LOG(FATAL). Protobuf library should not crash an user's program given a valid input. If the platform can not be supported, it should be reported at compile time. Though, in this case it seems easy enough to write a custom hash function if it's not already available in the platform headers. @matthauck @TeBoring Do you plan to actually implement this hash for int64? I saw this change while working on integrating github changes to our internal repo and I'm going to leave this change out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, whoops, sorry. 😞

The thought did not cross my mind to implement this on these platforms. I'd be open to helping out if you could give me some pointers on where to start.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess just an empty implementation would be enough. It's better to trigger compile error if the hash for int64 is used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, opened up two PR's to fix this missing hash: #2906 and #2907. Take your pick which fix you like better. :)

matthauck added a commit to matthauck/protobuf that referenced this pull request Mar 25, 2017
Rather than crashing on use (doh!) better to just declare this platform
is missing a proper hash_map/hash_set implementation and use
the std::map/std::set emulation.

Fixes regression introduced by protocolbuffers#1913
matthauck added a commit to matthauck/protobuf that referenced this pull request Mar 25, 2017
Rather than crashing on use (doh!) better to just implement the
missing std::tr1::hash structs.

Fixes regression introduced by protocolbuffers#1913
matthauck added a commit to matthauck/protobuf that referenced this pull request Mar 25, 2017
Rather than crashing on use (doh!) better to just declare this platform
is missing a proper hash_map/hash_set implementation and use
the std::map/std::set emulation.

Fixes regression introduced by protocolbuffers#1913
matthauck added a commit to matthauck/protobuf that referenced this pull request Mar 25, 2017
Rather than crashing on use (doh!) better to just implement the
missing std::tr1::hash structs.

Fixes regression introduced by protocolbuffers#1913
xfxyjwf pushed a commit that referenced this pull request Jul 10, 2017
Rather than crashing on use (doh!) better to just declare this platform
is missing a proper hash_map/hash_set implementation and use
the std::map/std::set emulation.

Fixes regression introduced by #1913
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants