Skip to content

generated_message_tctable_decl: improve portability: avoid ambiguous bool type, use uint8_t (#21815) #23021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link

generated_message_tctable_decl: improve portability: avoid ambiguous bool type, use uint8_t (#21815)

Fixes the failure on 32-bit powerpc:

In file included from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/message/internal/accessors.h:22,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/message/accessors.h:16,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/generated_code_support.h:13,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/reflection/cmake/google/protobuf/descriptor.upb.h:12,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/reflection/descriptor_bootstrap.h:14,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/reflection/common.h:15,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/reflection/enum_def.h:14,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/reflection/message_reserved_range.c:8:
/opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/message/internal/message.h: In function 'upb_TaggedAuxPtr_Extension':
/opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/message/internal/message.h:61:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   61 |   return (upb_Extension*)(ptr.ptr & ~1ULL);
      |          ^
In file included from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/src/google/protobuf/field_mask.pb.h:23,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/src/google/protobuf/[field_mask.pb.cc:6](http://field_mask.pb.cc:6/):
/opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/src/google/protobuf/generated_message_tctable_decl.h:260:34: error: static assertion failed
  260 | static_assert(sizeof(MapAuxInfo) <= 8, "");
      |               ~~~~~~~~~~~~~~~~~~~^~~~
/opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/src/google/protobuf/generated_message_tctable_decl.h:260:34: note: the comparison reduces to '(12 <= 8)'

Closes #21815

COPYBARA_INTEGRATE_REVIEW=#21815 from barracuda156:generated_message_tctable_decl 320ed68
FUTURE_COPYBARA_INTEGRATE_REVIEW=#21815 from barracuda156:generated_message_tctable_decl 320ed68

…bool type, use uint8_t (#21815)

Fixes the failure on 32-bit powerpc:
```
In file included from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/message/internal/accessors.h:22,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/message/accessors.h:16,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/generated_code_support.h:13,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/reflection/cmake/google/protobuf/descriptor.upb.h:12,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/reflection/descriptor_bootstrap.h:14,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/reflection/common.h:15,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/reflection/enum_def.h:14,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/reflection/message_reserved_range.c:8:
/opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/message/internal/message.h: In function 'upb_TaggedAuxPtr_Extension':
/opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/upb/message/internal/message.h:61:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   61 |   return (upb_Extension*)(ptr.ptr & ~1ULL);
      |          ^
In file included from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/src/google/protobuf/field_mask.pb.h:23,
                 from /opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/src/google/protobuf/[field_mask.pb.cc:6](http://field_mask.pb.cc:6/):
/opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/src/google/protobuf/generated_message_tctable_decl.h:260:34: error: static assertion failed
  260 | static_assert(sizeof(MapAuxInfo) <= 8, "");
      |               ~~~~~~~~~~~~~~~~~~~^~~~
/opt/local/var/macports/build/_opt_local_ppcports_devel_protobuf/protobuf/work/protobuf-30.2/src/google/protobuf/generated_message_tctable_decl.h:260:34: note: the comparison reduces to '(12 <= 8)'
```

Closes #21815

COPYBARA_INTEGRATE_REVIEW=#21815 from barracuda156:generated_message_tctable_decl 320ed68
FUTURE_COPYBARA_INTEGRATE_REVIEW=#21815 from barracuda156:generated_message_tctable_decl 320ed68
PiperOrigin-RevId: 791338110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant