Open diehlpk opened 10 months ago
Hello, @diehlpk. Since no one is currently assigned, I would like to take up this issue. Could you please provide me with a minimum example to reproduce it, and any other changes that you may have performed? My compiler does not report this, even after giving specific flags for reporting attribute errors. Thank you in advance!
Hello, @diehlpk. Since no one is currently assigned, I would like to take up this issue. Could you please provide me with a minimum example to reproduce it, and any other changes that you may have performed? My compiler does not report this, even after giving specific flags for reporting attribute errors. Thank you in advance!
Please go ahead. There is no need to ask for having a task 'assigned' to you. Just do it.
For the problem in question: this warning happens if the compiler first sees a type declared without an attribute, but later the same type is being declared/defined using an attribute, e.g.:
struct A;
struct HPX_EXPORT A {...};
The way to resolve this problem is to move the attribute to the first declaration and make sure that the compiler always sees this declaration before the later definition/declaration.
Hi @hkaiser. I was looking through this issue and I also couldn't reproduce it.
I'm not sure if I'm trying to reproduce it on the right place. I'm testing on branch 1.8.1
--that has the latest tag for the v1.8.1
release-- and running the same build steps found in the documentation.
After running cmake --build . --target install
I found another error:
/hpx/libs/core/iterator_support/include/hpx/iterator_support/counting_iterator.hpp:58:53: error: ‘intmax_t’ is not a member of ‘std’; did you mean ‘intmax_t’?
58 | (sizeof(Integer) >= sizeof(std::intmax_t)),
| ^~~~~~~~
This error happens because #include<cstdint>
is missing in hpx/libs/core/iterator_support/include/hpx/iterator_support/counting_iterator.hpp
and std::intmax_t
is being used.
It seems that this error is already fixed for version 1.9.x. Is there another branch for v1.8.1 that already solved those issues? I tested other branches like 1.8.1-rc2 and it has the same error.
I would love to subimit a PR for both issues.
Hello all! This might be a novice question, but is it at all possible that the initial warning is not being reported because the function defined in the file hasn’t been used yet?
Hi @hkaiser. I was looking through this issue and I also couldn't reproduce it.
I'm not sure if I'm trying to reproduce it on the right place. I'm testing on branch
1.8.1
--that has the latest tag for thev1.8.1
release-- and running the same build steps found in the documentation.After running
cmake --build . --target install
I found another error:/hpx/libs/core/iterator_support/include/hpx/iterator_support/counting_iterator.hpp:58:53: error: ‘intmax_t’ is not a member of ‘std’; did you mean ‘intmax_t’? 58 | (sizeof(Integer) >= sizeof(std::intmax_t)), | ^~~~~~~~
This error happens because
#include<cstdint>
is missing inhpx/libs/core/iterator_support/include/hpx/iterator_support/counting_iterator.hpp
andstd::intmax_t
is being used.It seems that this error is already fixed for version 1.9.x. Is there another branch for v1.8.1 that already solved those issues? I tested other branches like 1.8.1-rc2 and it has the same error.
I would love to subimit a PR for both issues.
Please test against the master branch as we will not patch up the old V1.8.1 release.
Hello all! This might be a novice question, but is it at all possible that the initial warning is not being reported because the function defined in the file hasn’t been used yet?
Could you be more specific, please? I'm not sure I understand what you're trying to say.
Please test against the master branch as we will not patch up the old V1.8.1 release.
I think maybe this issue is already solved. I tested it against master and enabled -Wattributes
, but couldn't find it.
Also, I found some other warnings from -Wattributes
that might be interesting to take a look:
/repos/hpx/libs/core/config/src/version.cpp:16:50: warning: ‘visibility’ attribute ignored [-Wattributes]
16 | HPX_CORE_EXPORT char const HPX_CHECK_VERSION[] =
| ^
/repos/hpx/libs/core/config/src/version.cpp:18:56: warning: ‘visibility’ attribute ignored [-Wattributes]
18 | HPX_CORE_EXPORT char const HPX_CHECK_BOOST_VERSION[] =
| ^
[546/803] Building CXX object components/containers/partitioned_vector/CMakeFiles/partitioned_vector_component.dir/src/partitioned_vector_component_std_string.cpp.o
/repos/hpx/components/containers/partitioned_vector/src/partitioned_vector_component_std_string.cpp:31:18: warning: type attributes ignored after type is already defined [-Wattributes]
31 | hpx::server::partitioned_vector<std::string, std::vector<std::string>>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[547/803] Building CXX object components/containers/partitioned_vector/CMakeFiles/partitioned_vector_component.dir/src/partitioned_vector_component_double.cpp.o
/repos/hpx/components/containers/partitioned_vector/src/partitioned_vector_component_double.cpp:28:18: warning: type attributes ignored after type is already defined [-Wattributes]
28 | hpx::server::partitioned_vector<double, std::vector<double>>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[556/803] Building CXX object components/containers/partitioned_vector/CMakeFiles/partitioned_vector_component.dir/src/partitioned_vector_component_int.cpp.o
/repos/hpx/components/containers/partitioned_vector/src/partitioned_vector_component_int.cpp:30:18: warning: type attributes ignored after type is already defined [-Wattributes]
30 | hpx::server::partitioned_vector<int, std::vector<int>>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/repos/hpx/components/containers/partitioned_vector/src/partitioned_vector_component_int.cpp:43:18: warning: type attributes ignored after type is already defined [-Wattributes]
43 | hpx::server::partitioned_vector<long long, std::vector<long long>>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
They seem to be around for a wile. I don't know if they are supposed to be fixed or not.
Please test against the master branch as we will not patch up the old V1.8.1 release.
I think maybe this issue is already solved. I tested it against master and enabled
-Wattributes
, but couldn't find it.Also, I found some other warnings from
-Wattributes
that might be interesting to take a look:/repos/hpx/libs/core/config/src/version.cpp:16:50: warning: ‘visibility’ attribute ignored [-Wattributes] 16 | HPX_CORE_EXPORT char const HPX_CHECK_VERSION[] = | ^ /repos/hpx/libs/core/config/src/version.cpp:18:56: warning: ‘visibility’ attribute ignored [-Wattributes] 18 | HPX_CORE_EXPORT char const HPX_CHECK_BOOST_VERSION[] = | ^ [546/803] Building CXX object components/containers/partitioned_vector/CMakeFiles/partitioned_vector_component.dir/src/partitioned_vector_component_std_string.cpp.o /repos/hpx/components/containers/partitioned_vector/src/partitioned_vector_component_std_string.cpp:31:18: warning: type attributes ignored after type is already defined [-Wattributes] 31 | hpx::server::partitioned_vector<std::string, std::vector<std::string>>; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [547/803] Building CXX object components/containers/partitioned_vector/CMakeFiles/partitioned_vector_component.dir/src/partitioned_vector_component_double.cpp.o /repos/hpx/components/containers/partitioned_vector/src/partitioned_vector_component_double.cpp:28:18: warning: type attributes ignored after type is already defined [-Wattributes] 28 | hpx::server::partitioned_vector<double, std::vector<double>>; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [556/803] Building CXX object components/containers/partitioned_vector/CMakeFiles/partitioned_vector_component.dir/src/partitioned_vector_component_int.cpp.o /repos/hpx/components/containers/partitioned_vector/src/partitioned_vector_component_int.cpp:30:18: warning: type attributes ignored after type is already defined [-Wattributes] 30 | hpx::server::partitioned_vector<int, std::vector<int>>; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /repos/hpx/components/containers/partitioned_vector/src/partitioned_vector_component_int.cpp:43:18: warning: type attributes ignored after type is already defined [-Wattributes] 43 | hpx::server::partitioned_vector<long long, std::vector<long long>>; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
They seem to be around for a wile. I don't know if they are supposed to be fixed or not.
Yes, those should be fixed (suppressed). Thanks!
Expected Behavior
No warning should appear.
Actual Behavior
Specifications
... Please describe your environment