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

[Bug]: warn_unused_result compilation error in dispenso/priority.cpp for Linux #27

Closed
1 task done
AbrilRBS opened this issue Feb 23, 2024 · 7 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working

Comments

@AbrilRBS
Copy link

AbrilRBS commented Feb 23, 2024

Contact Details

N/A

What happened?

While trying to package the library for Conan Center Index, I've come across a compilation issue due to warn_unused_result and the default -Werror.

dispenso/1.2.0: Calling build()
dispenso/1.2.0: Running CMake.configure()
dispenso/1.2.0: RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/root/.conan2/p/b/dispe38c8bf72dbfa0/b/build/Release/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/root/.conan2/p/b/dispe38c8bf72dbfa0/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src"
-- Using Conan toolchain: /root/.conan2/p/b/dispe38c8bf72dbfa0/b/build/Release/generators/conan_toolchain.cmake
-- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC)
-- Conan toolchain: C++ Standard 17 with extensions ON
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
SOURCES:  /root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/detail/per_thread_info.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/detail/quanta.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/graph.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/graph_executor.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/pool_allocator.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/priority.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/schedulable.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/small_buffer_allocator.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/task_set.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/thread_id.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/thread_pool.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/timed_task.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/timing.cpp;/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/tsan_annotations.cpp
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /root/.conan2/p/b/dispe38c8bf72dbfa0/b/build/Release

dispenso/1.2.0: Running CMake.build()
dispenso/1.2.0: RUN: cmake --build "/root/.conan2/p/b/dispe38c8bf72dbfa0/b/build/Release" -- -j12
[  6%] Building CXX object dispenso/CMakeFiles/dispenso.dir/detail/per_thread_info.cpp.o
[ 13%] Building CXX object dispenso/CMakeFiles/dispenso.dir/graph.cpp.o
[ 26%] Building CXX object dispenso/CMakeFiles/dispenso.dir/detail/quanta.cpp.o
[ 33%] Building CXX object dispenso/CMakeFiles/dispenso.dir/pool_allocator.cpp.o
[ 26%] Building CXX object dispenso/CMakeFiles/dispenso.dir/graph_executor.cpp.o
[ 46%] Building CXX object dispenso/CMakeFiles/dispenso.dir/priority.cpp.o
[ 46%] Building CXX object dispenso/CMakeFiles/dispenso.dir/schedulable.cpp.o
[ 53%] Building CXX object dispenso/CMakeFiles/dispenso.dir/small_buffer_allocator.cpp.o
[ 60%] Building CXX object dispenso/CMakeFiles/dispenso.dir/thread_id.cpp.o
[ 66%] Building CXX object dispenso/CMakeFiles/dispenso.dir/task_set.cpp.o
[ 73%] Building CXX object dispenso/CMakeFiles/dispenso.dir/thread_pool.cpp.o
[ 80%] Building CXX object dispenso/CMakeFiles/dispenso.dir/timed_task.cpp.o
[ 86%] Building CXX object dispenso/CMakeFiles/dispenso.dir/timing.cpp.o
[ 93%] Building CXX object dispenso/CMakeFiles/dispenso.dir/tsan_annotations.cpp.o
/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/priority.cpp: In function ‘bool dispenso::setCurrentThreadPriority(dispenso::ThreadPriority)’:
/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/priority.cpp:136:11: error: ignoring return value of ‘int nice(int)’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
  136 |       nice(10);
      |       ~~~~^~~~
/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/priority.cpp:140:11: error: ignoring return value of ‘int nice(int)’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
  140 |       nice(0);
      |       ~~~~^~~
/root/.conan2/p/b/dispe38c8bf72dbfa0/b/src/dispenso/priority.cpp:152:11: error: ignoring return value of ‘int nice(int)’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
  152 |       nice(static_cast<int>(20 - rlim.rlim_max));
      |       ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

I'm running

# uname -a
Linux 7e741cff55e1 6.6.12-linuxkit #1 SMP Thu Feb  8 06:36:34 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

and I'm compiling with

arch=armv8
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux

This might be something on my end so sorry about the noise if that's the case, I've tried to check for missconfigurations on my end but I can't see where I would be going wrong :)

Version

1.0 (Default)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@AbrilRBS AbrilRBS added the bug Something isn't working label Feb 23, 2024
@AbrilRBS AbrilRBS changed the title [Bug]: warn_unused_result` compilation error [Bug]: warn_unused_result compilation error in dispenso/priority.cpp for Linux Feb 23, 2024
@graphicsMan
Copy link
Contributor

Thanks for the report. I'll try to fix this early next week.

@graphicsMan
Copy link
Contributor

Hi @RubenRBS Have you tried at main branch instead of release 1.2? I believe this has been addressed.

@AbrilRBS
Copy link
Author

Hi @graphicsMan thanks for the suggestion, seems like the current head commit does indeed compile, sorry for the noise!

Will there be a tagged release any time soon? I'd much rather merge the Conan recipe once Linux is available so I don't mind waiting :)

@graphicsMan
Copy link
Contributor

graphicsMan commented Feb 26, 2024

I have a few more minor fixes that can go in too. I'll cut a new release once those are all in, which shouldn't be long. Maybe another week or so.

@graphicsMan
Copy link
Contributor

Slowly making progress on this. I was out for more than a week with COVID, so please bear with me :)

@graphicsMan
Copy link
Contributor

Big apologies for this taking so long! Release 1.3 was just cut. Let me know if you run into more issues!

@AbrilRBS
Copy link
Author

AbrilRBS commented Apr 29, 2024

Hi @graphicsMan thanks a lot for taking the time to address the issue, I appreciate it :)

I've now been able to compile in all my supported configurations without issues with the new 1.3 version, so hopefuly conan-io/conan-center-index#22876 gets merged soon 🤞

Thanks a lot for all your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants