1. 07 Apr, 2025 2 commits
  2. 17 Mar, 2025 2 commits
    • Robert Edmonds's avatar
      Merge pull request #768 from protobuf-c/edmonds/more-google-protobuf-30-fixes · 63dee703
      Robert Edmonds authored
      protoc-gen-c: Explicitly construct strings where needed for protobuf 30.x
      63dee703
    • Robert Edmonds's avatar
      protoc-gen-c: Explicitly construct strings where needed for protobuf 30.x · 9f1e80e2
      Robert Edmonds authored
      protobuf 30.x changes various APIs to return string_view's rather than
      string&'s. This broke protobuf-c, since we were relying on the implicit
      construction of strings from string&'s in various places.
      
      This commit explicitly constructs strings from the string_view's
      returned by the protobuf 30.x API when we need to store an owned string
      (e.g. in a hash map). This maintains compatibility with older versions
      of protobuf such as 3.21 in Debian/Ubuntu while extending compatibility
      to the latest protobuf 30.x.
      
      Without this commit we get lots of errors like this when compiling
      against protobuf 30.x:
      
          protoc-gen-c/c_field.cc:119:43: error: no match for 'operator=' (operand types are 'std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >::mapped_type' {aka 'std::__cxx11::basic_string<char>'} and 'google::protobuf::internal::DescriptorStringView' {aka 'absl::debian7::string_view'})
      9f1e80e2
  3. 08 Mar, 2025 1 commit
  4. 09 Feb, 2025 10 commits
  5. 08 Feb, 2025 1 commit
  6. 02 Feb, 2025 2 commits
  7. 27 Jan, 2025 1 commit
  8. 26 Jan, 2025 15 commits
  9. 25 Jan, 2025 2 commits
  10. 21 Jan, 2025 3 commits
    • Robert Edmonds's avatar
      protoc-c: c_message: Add extra braces to initialize a oneof union containing a ProtobufCBinaryData · cecf01e6
      Robert Edmonds authored
      Certain compilers (e.g. [0]) incorrectly generate warning messages
      when the universal zero initializer is used by the protobuf-c generated
      code to initialize a protobuf object containing a oneof that contains a
      ProtobufCBinaryData field as the first member. This is now much more
      likely due to the change in the previous commit ("protoc-c: c_message:
      Order oneof union members from largest to smallest") which will now
      always cause a ProtobufCBinaryData field to be placed as the first
      member of the union, if one is present in the oneof.
      
      In this situation, we need to add an extraneous pair of braces around
      the universal zero initializer in the generated initialization code.
      
      The former behavior of using the universal zero initializer by itself is
      kept for oneof unions that do not contain a ProtobufCBinaryData member.
      
      [0]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80454
      cecf01e6
    • Robert Edmonds's avatar
      protoc-c: c_message: Order oneof union members from largest to smallest · 36485387
      Robert Edmonds authored
      This commit changes the code generator to output the members of a oneof
      union from largest to smallest, rather than in field descriptor order.
      
      This is necessary on certain compilers such as gcc >= 15 which do not
      guarantee that initializing a union with the universal zero initializer
      actually initializes all the bits of the object representation of the
      members of the union, unless the largest union member is the first
      member of the union.
      36485387
    • Robert Edmonds's avatar
      t/issue745/: Add test case for #745 · 040e9eb0
      Robert Edmonds authored
      This currently fails on gcc 15 but succeeds on gcc 14, as expected.
      040e9eb0
  11. 20 Jan, 2025 1 commit