Bug 531483 - boost::optional warning: dereferencing pointer ‘<anonymous>’ does break strict-aliasing rules
Summary: boost::optional warning: dereferencing pointer ‘<anonymous>’ does break stric...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: boost
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Benjamin Kosnik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-28 14:44 UTC by Caolan McNamara
Modified: 2013-08-09 05:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-07-15 11:15:07 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
This is quite possibly a totally incorrect fix, but its based off the aligned_storage.hpp impl mentioned in optional.hpp's header and it does silence the warnings (394 bytes, patch)
2009-10-28 14:44 UTC, Caolan McNamara
no flags Details | Diff
sample source (298 bytes, text/plain)
2009-10-28 14:45 UTC, Caolan McNamara
no flags Details

Description Caolan McNamara 2009-10-28 14:44:04 UTC
Created attachment 366447 [details]
This is quite possibly a totally incorrect fix, but its based off the aligned_storage.hpp impl mentioned in optional.hpp's header and it does silence the warnings

Description of problem:
Warnings when using boost::optional with -fstrict-aliasing

Version-Release number of selected component (if applicable):
boost-1.39.0-8.fc12.x86_64

How reproducible:
100%

Steps to Reproduce:
1. g++ -Wstrict-aliasing -O2 -c test.cpp
  
Actual results:
test.cpp: In function ‘bool bar()’:
test.cpp:14: warning: dereferencing pointer ‘<anonymous>’ does break strict-aliasing rules
test.cpp:14: note: initialized from here

Expected results:
No warnings

Additional info:
Some discussion here: http://lists.boost.org/Archives/boost/2009/05/151305.php

Comment 1 Caolan McNamara 2009-10-28 14:45:14 UTC
Created attachment 366448 [details]
sample source

Comment 2 Noura El hawary 2009-11-16 15:43:49 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Caolan McNamara 2010-07-15 11:15:07 UTC
This was fixed with gcc 4.5 as found in F-14, gcc issue not boost.


Note You need to log in before you can comment on or make changes to this bug.