Skip to content
New issue

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

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

Already on GitHub? # to your account

Generated C++ code with dllexport_decl and deprecated incompatible with GCC 12 or older #19447

Open
cho-m opened this issue Nov 28, 2024 · 0 comments
Assignees
Labels

Comments

@cho-m
Copy link
Contributor

cho-m commented Nov 28, 2024

What version of protobuf and what language are you using?
Version: v29.0
Language: C++

What operating system (Linux, Windows, ...) and version?
Linux Ubuntu 22.04

What runtime / compiler are you using (e.g., python version or gcc version)
GCC 11

What did you do?
Steps to reproduce the behavior:

  1. Build Protobuf v29.0 release
  2. Generate C++ code with option deprecated = true and --cpp_out=dllexport_decl=...
  3. Use GCC 11 (or 12) to compile resulting code
  4. See syntax errors

Specifically seen when building Apache Arrow but a minimal .proto should also work.

What did you expect to see
Successful compilation.

Or at least a documented mention of minimum GCC change. I would have thought https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md applied based on https://protobuf.dev/support/version-support/#changes

What did you see instead?

Compilation failure (most likely from 23aada2). Seen while updating to Protobuf 29 in Homebrew Homebrew/homebrew-core#199285

apache-arrow-18.1.0/build/src/arrow/flight/sql/FlightSql.pb.h:6442:31: error: expected identifier before ‘[’ token
 6442 | class ARROW_FLIGHT_SQL_EXPORT [[deprecated]] ActionCancelQueryResult final
      |                               ^

Anything else we should know about your project / environment

Building in Homebrew environment.

May be related to https://developers.redhat.com/articles/2023/06/21/new-c-features-gcc-13#additional_updates which mentions GCC 13 is the first release to support mixing of GNU and standard attributes.

No compilation issues on GCC 13 or 14.

@cho-m cho-m added the untriaged auto added to all issues by default when created. label Nov 28, 2024
@shaod2 shaod2 added c++ and removed untriaged auto added to all issues by default when created. labels Dec 9, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants