Skip to content
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

ABI that depends on C++ standard of downstream compilation unit in latest master? #1502

Open
2 tasks done
traversaro opened this issue Sep 19, 2020 · 0 comments
Open
2 tasks done
Labels
type: bug Indicates an unexpected problem or unintended behavior

Comments

@traversaro
Copy link
Contributor

By inspecting the DART source code, I noticed that the dart::common::optional class introduced in #1416 changes its ABI depending on the compilation flags of the compilation unit in which it is compiled. This may mean that one compilation unit creates a function that takes a dart::common::optional class with C++14, and another compilation unit uses this function in C++17, leading to a runtime error.

This kind of practice are allowed in some libraries (abseil, for example) that are meant to be compiled in enviroments where all the source code are compiled with exactly the same compilation option, but that is typically not the case for projects like DART that are used from binary packages compiled for Linux distributions.

Bug Report

  • I checked the documentation and the forum but found no answer.
  • I checked to make sure that this issue has not already been filed.

Environment

Select the following information.

  • DART version: master
  • OS name and version name(or number): any
  • Compiler name and version number: any

Expected Behavior

I would expect that, once configured and compiled, the ABI of the struct and classes present in DART headers would not change based on the compilation option of downstream projects.

Current Behavior

I did not any extensive test, but by inspection of the dart::common::optional class it seems that its ABI changes depending on the compilation option of downstream projects.

@traversaro traversaro added the type: bug Indicates an unexpected problem or unintended behavior label Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant