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

The Visibility bug from issue 242's back #372

Closed
Philippe593 opened this issue Dec 19, 2024 · 4 comments
Closed

The Visibility bug from issue 242's back #372

Philippe593 opened this issue Dec 19, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Philippe593
Copy link

Hi,

While compiling, cmake throws a cog with these messages :

[ 70%] Building CXX object adaptations/CMakeFiles/knobkraft-generic-adaptation.dir/CreateNewAdaptationDialog.cpp.o In file included from /home/philippe/git/KnobKraft-orm/adaptations/CreateNewAdaptationDialog.cpp:9: /home/philippe/git/KnobKraft-orm/adaptations/GenericAdaptation.h:50:65: warning: ‘visibility’ attribute ignored [-Wattributes] 50 | #define DEFAULT_VISIBILITY __attribute__((visibility("default"))) | ^ /home/philippe/git/KnobKraft-orm/adaptations/GenericAdaptation.h:189:52: note: in expansion of macro ‘DEFAULT_VISIBILITY’ 189 | pybind11::module adaptation_module DEFAULT_VISIBILITY; | ^~~~~~~~~~~~~~~~~~ /home/philippe/git/KnobKraft-orm/adaptations/GenericAdaptation.h:56:15: warning: ‘knobkraft::GenericAdaptation’ declared with greater visibility than the type of its field ‘knobkraft::GenericAdaptation::adaptation_module’ [-Wattributes] 56 | class GenericAdaptation : public midikraft::Synth, public midikraft::SimpleDiscoverableDevice, | ^~~~~~~~~~~~~~~~~ [ 70%] Building CXX object adaptations/CMakeFiles/knobkraft-generic-adaptation.dir/GenericAdaptation.cpp.o In file included from /home/philippe/git/KnobKraft-orm/adaptations/GenericAdaptation.cpp:7: /home/philippe/git/KnobKraft-orm/adaptations/GenericAdaptation.h:50:65: warning: ‘visibility’ attribute ignored [-Wattributes] 50 | #define DEFAULT_VISIBILITY __attribute__((visibility("default"))) | ^ /home/philippe/git/KnobKraft-orm/adaptations/GenericAdaptation.h:189:52: note: in expansion of macro ‘DEFAULT_VISIBILITY’ 189 | pybind11::module adaptation_module DEFAULT_VISIBILITY; | ^~~~~~~~~~~~~~~~~~ /home/philippe/git/KnobKraft-orm/adaptations/GenericAdaptation.h:56:15: warning: ‘knobkraft::GenericAdaptation’ declared with greater visibility than the type of its field ‘knobkraft::GenericAdaptation::adaptation_module’ [-Wattributes] 56 | class GenericAdaptation : public midikraft::Synth, public midikraft::SimpleDiscoverableDevice, | ^~~~~~~~~~~~~~~~~ /home/philippe/git/KnobKraft-orm/adaptations/GenericAdaptation.h:50:65: warning: ‘visibility’ attribute ignored [-Wattributes] 50 | #define DEFAULT_VISIBILITY __attribute__((visibility("default"))) | ^ /home/philippe/git/KnobKraft-orm/adaptations/PythonUtils.h:32:34: note: in expansion of macro ‘DEFAULT_VISIBILITY’ 32 | pybind11::object _stdout DEFAULT_VISIBILITY; | ^~~~~~~~~~~~~~~~~~ /home/philippe/git/KnobKraft-orm/adaptations/GenericAdaptation.h:50:65: warning: ‘visibility’ attribute ignored [-Wattributes] 50 | #define DEFAULT_VISIBILITY __attribute__((visibility("default"))) | ^ /home/philippe/git/KnobKraft-orm/adaptations/PythonUtils.h:33:34: note: in expansion of macro ‘DEFAULT_VISIBILITY’ 33 | pybind11::object _stderr DEFAULT_VISIBILITY; | ^~~~~~~~~~~~~~~~~~ /home/philippe/git/KnobKraft-orm/adaptations/GenericAdaptation.h:50:65: warning: ‘visibility’ attribute ignored [-Wattributes] 50 | #define DEFAULT_VISIBILITY __attribute__((visibility("default"))) | ^ /home/philippe/git/KnobKraft-orm/adaptations/PythonUtils.h:34:41: note: in expansion of macro ‘DEFAULT_VISIBILITY’ 34 | pybind11::object _stdout_buffer DEFAULT_VISIBILITY; | ^~~~~~~~~~~~~~~~~~ /home/philippe/git/KnobKraft-orm/adaptations/GenericAdaptation.h:50:65: warning: ‘visibility’ attribute ignored [-Wattributes] 50 | #define DEFAULT_VISIBILITY __attribute__((visibility("default"))) | ^ /home/philippe/git/KnobKraft-orm/adaptations/PythonUtils.h:35:41: note: in expansion of macro ‘DEFAULT_VISIBILITY’ 35 | pybind11::object _stderr_buffer DEFAULT_VISIBILITY; | ^~~~~~~~~~~~~~~~~~ In file included from /home/philippe/git/KnobKraft-orm/adaptations/GenericAdaptation.cpp:13: /home/philippe/git/KnobKraft-orm/adaptations/PythonUtils.h:20:7: warning: ‘PyStdErrOutStreamRedirect’ declared with greater visibility than the type of its field ‘PyStdErrOutStreamRedirect::_stdout’ [-Wattributes] 20 | class PyStdErrOutStreamRedirect { | ^~~~~~~~~~~~~~~~~~~~~~~~~
I searched the issues and saw it had been solved with issue 242.
Seems it's back, unfortunately.
Any ideas on how to kill it for good ?
TIA
Philippe

@christofmuc
Copy link
Owner

Hm, I looked at that but the fix from back then was only to make the warning as error go away on Linux.

Can you give a bit more info on what platform you are on, and which compiler version you are using? We have builds that work on Ubuntu 22 and Ubuntu 24, but other platforms might differ. I recall this was about the gcc version, what are you seeing?

@christofmuc christofmuc added the bug Something isn't working label Dec 24, 2024
@Philippe593
Copy link
Author

My gcc version is 14.2, on Ubuntu 24.10.

@christofmuc
Copy link
Owner

These warnings come from pybind11, this is a currently open question in pybind11 about this topic:

pybind/pybind11#4862

The suggested solution is to set a global compiler parameter -fvisibility=hidden. Unsatisfactory, but I can give it a try.

@christofmuc christofmuc added the Ready for release Will be part of the next release label Dec 30, 2024
@christofmuc
Copy link
Owner

Fixed with release 2.5.0

@christofmuc christofmuc removed the Ready for release Will be part of the next release label Jan 19, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants