Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1072633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:53:15+00:00 2026-05-16T20:53:15+00:00

In my project, I recently decided to use boost::thread. My code compiles fine under

  • 0

In my project, I recently decided to use boost::thread. My code compiles fine under Linux, but under Windows (either x86 or x64), I get the following warnings with gcc 4.5:

In file included from C:\Boost\include\boost-1_44/boost/thread/shared_mutex.hpp:14:0,
                 from C:\Boost\include\boost-1_44/boost/thread/detail/thread_group.hpp:9,
                 from C:\Boost\include\boost-1_44/boost/thread/thread.hpp:24,
                 from C:\Boost\include\boost-1_44/boost/thread.hpp:13,
                 from include\systools/upnp_control_point.hpp:50,
                 from src\upnp_control_point.cpp:45:
C:\Boost\include\boost-1_44/boost/thread/win32/shared_mutex.hpp: In member function 'T boost::shared_mutex::interlocked_
compare_exchange(T*, T, T) [with T = boost::shared_mutex::state_data]':
C:\Boost\include\boost-1_44/boost/thread/win32/shared_mutex.hpp:110:103:   instantiated from here
C:\Boost\include\boost-1_44/boost/thread/win32/shared_mutex.hpp:50:99: error: dereferencing type-punned pointer will bre
ak strict-aliasing rules
C:\Boost\include\boost-1_44/boost/thread/win32/shared_mutex.hpp:50:99: error: dereferencing type-punned pointer will bre
ak strict-aliasing rules
C:\Boost\include\boost-1_44/boost/thread/win32/shared_mutex.hpp:51:52: error: dereferencing type-punned pointer will bre
ak strict-aliasing rules
C:\Boost\include\boost-1_44/boost/thread/win32/shared_mutex.hpp:51:52: error: dereferencing type-punned pointer will bre
ak strict-aliasing rules
In file included from C:\Boost\include\boost-1_44/boost/algorithm/string/detail/find_format.hpp:18:0,
                 from C:\Boost\include\boost-1_44/boost/algorithm/string/find_format.hpp:23,
                 from C:\Boost\include\boost-1_44/boost/algorithm/string/replace.hpp:22,
                 from C:\Boost\include\boost-1_44/boost/date_time/date_facet.hpp:17,
                 from C:\Boost\include\boost-1_44/boost/date_time/gregorian/gregorian_io.hpp:16,
                 from C:\Boost\include\boost-1_44/boost/date_time/gregorian/gregorian.hpp:31,
                 from C:\Boost\include\boost-1_44/boost/date_time/posix_time/time_formatters.hpp:12,
                 from C:\Boost\include\boost-1_44/boost/date_time/posix_time/posix_time.hpp:24,
                 from include\systools/upnp_device.hpp:51,
                 from include\systools/upnp_control_point.hpp:48,
                 from src\upnp_control_point.cpp:45:
C:\Boost\include\boost-1_44/boost/algorithm/string/detail/find_format_store.hpp: At global scope:
C:\Boost\include\boost-1_44/boost/algorithm/string/detail/find_format_store.hpp: In instantiation of 'bool boost::algori
thm::detail::check_find_result(InputT&, FindResultT&) [with InputT = std::basic_string<char>, FindResultT = boost::itera
tor_range<__gnu_cxx::__normal_iterator<char*, std::basic_string<char> > >]':
C:\Boost\include\boost-1_44/boost/algorithm/string/detail/find_format_all.hpp:259:17:   instantiated from 'void boost::a
lgorithm::detail::find_format_all_impl(InputT&, FinderT, FormatterT, FindResultT) [with InputT = std::basic_string<char>
, FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algori
thm::detail::const_formatF<boost::iterator_range<const char*> >, FindResultT = boost::iterator_range<__gnu_cxx::__normal
_iterator<char*, std::basic_string<char> > >]'
C:\Boost\include\boost-1_44/boost/algorithm/string/find_format.hpp:268:13:   instantiated from 'void boost::algorithm::f
ind_format_all(SequenceT&, FinderT, FormatterT) [with SequenceT = std::basic_string<char>, FinderT = boost::algorithm::d
etail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::const_formatF<boos
t::iterator_range<const char*> >]'
C:\Boost\include\boost-1_44/boost/algorithm/string/replace.hpp:654:13:   instantiated from 'void boost::algorithm::repla
ce_all(SequenceT&, const Range1T&, const Range2T&) [with SequenceT = std::basic_string<char>, Range1T = char [15], Range
2T = char [1]]'
C:\Boost\include\boost-1_44/boost/units/detail/utility.hpp:50:51:   instantiated from here
C:\Boost\include\boost-1_44/boost/algorithm/string/detail/find_format_store.hpp:74:18: error: unused parameter 'Input'
scons: *** [src\upnp_control_point.o] Error 1
scons: building terminated because of errors.

I just included <boost/thread.hpp> in my own .cpp file, nothing special.

Since I have no control over boost’s code, is there a way to suppress those warnings temporarily ? Something like:

#super_killing_macro_that_disable_some_warnings
#include <boost/thread.hpp>
#its_all_good_know_i_want_my_warnings_back

What can I do ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:53:15+00:00Added an answer on May 16, 2026 at 8:53 pm

    I just discovered the -isystem option that allow to include a directory as a system directory. No warnings are emited from files within thoses directories so it seems perfect for my task.

    Also, this has the neat side effect to make SCons ignore those directories as well in the dependency tree. Since I’m not expecting those libraries to change often, it’s fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently started a project where the team decided we'd like to use jQuery
I started a Rails project recently and decided to use RESTful controllers. I created
Background info: I've recently decided to take on a project of making a social
I have started to work on maven project recently. The piece of code I
I have been looking through some code on an open source project recently and
I'm reviewing some code on the project I recently joined, and in a C#
Recently we have released our product. Our team decided to preserve the source code
Recently we decided to make a general guideline for certain Rails3 project. And we
I'm a web-designer and former coder. Recently I decided to start own project and
I've recently decided to take on a pretty big software engineering project that will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.