Subject: [Boost-bugs] [Boost C++ Libraries] #4127: warning break strict-aliasing rules
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-04-20 18:07:58
#4127: warning break strict-aliasing rules
-------------------------------------+--------------------------------------
Reporter: anonymous | Owner: pdimov
Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: smart_ptr
Version: Boost Development Trunk | Severity: Problem
Keywords: warning strict-aliasing |
-------------------------------------+--------------------------------------
Hello,
under x86_64, using g++ 4.4.1 with '-W -Wall -O3' , when trying to compile
the code below
[code]
#include "boost/make_shared.hpp"
#include <iostream>
int main(void)
{
boost::shared_ptr<std::string> x =
boost::make_shared<std::string>("hello, world!");
std::cout << *x;
}
[/code] (copied from make_shared doc)
I get the folowing warnings:
>>> boost/smart_ptr/make_shared.hpp:52: warning: dereferencing type-punned
pointer will break strict-aliasing rules
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4127> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC