GithubHelp home page GithubHelp logo

Comments (8)

hkaiser avatar hkaiser commented on June 6, 2024 2

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.

from hpx.

Komal0103 avatar Komal0103 commented on June 6, 2024

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!

from hpx.

andremralves avatar andremralves commented on June 6, 2024

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.

from hpx.

Komal0103 avatar Komal0103 commented on June 6, 2024

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?

from hpx.

hkaiser avatar hkaiser commented on June 6, 2024

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.

Please test against the master branch as we will not patch up the old V1.8.1 release.

from hpx.

hkaiser avatar hkaiser commented on June 6, 2024

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.

from hpx.

andremralves avatar andremralves commented on June 6, 2024

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.

from hpx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.