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

Warnings during cmake build-test #831

Closed
unbtorsten opened this issue Oct 19, 2023 · 3 comments
Closed

Warnings during cmake build-test #831

unbtorsten opened this issue Oct 19, 2023 · 3 comments

Comments

@unbtorsten
Copy link
Contributor

Not strictly a bug, but could turn into one or more bugs, if ignored for too long:

To Reproduce
Steps to reproduce the behavior:

  1. Clone HighFive repository and cd into local repo
  2. $ cmake -B build-test .
  3. $ cmake --build build-test --parallel

This yields the following warnings:

HighFive/tests/unit/tests_high_five_base.cpp:326:13: warning: ‘HighFive::DataSet::DataSet()’ is deprecated: "Default constructor creates unsafe uninitialized objects" [-Wdeprecated-declarations]
  326 |     DataSet d2;  // deprecated as it constructs unsafe objects
      |             ^~
In file included from HighFive/tests/unit/tests_high_five_base.cpp:21:
HighFive/include/highfive/H5DataSet.hpp:103:5: note: declared here
  103 |     DataSet() = default;
      |     ^~~~~~~
HighFive/tests/unit/tests_high_five_base.cpp: In function ‘void CATCH2_INTERNAL_TEST_44()’:
HighFive/tests/unit/tests_high_five_base.cpp:758:45: warning: ‘haddr_t HighFive::ObjectInfo::getAddress() const’ is deprecated: "Deprecated since HighFive 2.2. Soon supporting VOL tokens" [-Wdeprecated-declarations]
  758 |     auto addr = dataset.getInfo().getAddress();
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from HighFive/include/highfive/H5Object.hpp:155,
                 from HighFive/include/highfive/H5DataSpace.hpp:17,
                 from HighFive/include/highfive/H5DataSet.hpp:13:
HighFive/include/highfive/bits/H5Object_misc.hpp:109:16: note: declared here
  109 | inline haddr_t ObjectInfo::getAddress() const noexcept {
      |                ^~~~~~~~~~

Expected behavior
No warnings

Desktop:

  • OS: Debian 12
  • CMake 3.25.1
  • gcc 12.2.0

I may be able to look into this further in the next few days. For now, I didn't want to just ignore it.

@1uc
Copy link
Collaborator

1uc commented Oct 19, 2023

The first one is benign, for historical reasons DataSet used to have a default ctor. Then someone decided that it made little sense to have a DataSet object that doesn't actually refer to a dataset in some file. Hence, they deprecated the default ctor. However, to ensure that we don't accidentally remove it; and thereby break users code, there's this test.

One could probably push and pop -Wdeprecated; but one might need to do so for clang, GCC and MSVC.

The other one predates me and I don't understand why it's deprecated. There's certainly no active push towards VOL in HighFive right now. I used to assume that it's because something that's deprecated in HDF5, but a quick search:
https://docs.hdfgroup.org/hdf5/v1_10/struct_h5_o__info__t.html
https://docs.hdfgroup.org/hdf5/develop/struct_h5_o__info1__t.html
doesn't lead to anything obviously deprecated in HDF5.

@1uc
Copy link
Collaborator

1uc commented Oct 19, 2023

Yes, both warnings are annoying.

@unbtorsten
Copy link
Contributor Author

Understood. This touches on a broader context of when and how to deprecate functionality/interfaces. I suggest adding some more comments for future reference and wouldn't pursue this at this time: #832

@unbtorsten unbtorsten closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants