incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Updated: (STDCXX-350) [gcc 4.1.1] -O2 warning: std::temporary_buffer dereferences type-punned pointer
Date Sat, 20 Oct 2007 21:51:50 GMT

     [ https://issues.apache.org/jira/browse/STDCXX-350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Martin Sebor updated STDCXX-350:
--------------------------------

             Severity: Compiler Warning
           Regression: [Regression]
    Affects Version/s:     (was: 4.1.4)
                           (was: 4.1.3)
                       trunk
        Fix Version/s: 4.2

The warning could potentially indicate a serious problem. Since it's a regression from 4.1.3
(see the following post: http://www.nabble.com/Re%3A--VOTE--release-stdcxx-4.2.0-p13321880.html)
and since the fix is easy, I'm scheduling it for 4.2.

> [gcc 4.1.1] -O2 warning: std::temporary_buffer dereferences type-punned pointer
> -------------------------------------------------------------------------------
>
>                 Key: STDCXX-350
>                 URL: https://issues.apache.org/jira/browse/STDCXX-350
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 20. General Utilities
>    Affects Versions: trunk
>         Environment: gcc 4.1.1 -O2, Solaris 10
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>             Fix For: 4.2
>
>
> Compiling the following program with gcc 4.1.1 on Solaris 10 produces the warning below:
> $ cat t.cpp && gmake -r t
> #include <memory>
> int main ()
> {
>     std::get_temporary_buffer<int>(1);
> }
> gcc -c -I/amd/devco/sebor/stdcxx/include/ansi   -pthreads -I/amd/devco/sebor/stdcxx/include
-I/build/sebor/gcc-4.1.1-12d/include -I/amd/devco/sebor/stdcxx/examples/include  -pedantic
-nostdinc++ -O2  -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long   t.cpp
> /amd/devco/sebor/stdcxx/include/rw/_rawiter.h: In function 'std::pair<_TypeT*, _Distance>
std::get_temporary_buffer(_Distance, _TypeT*) [with _TypeT = int, _Distance = int]':
> /amd/devco/sebor/stdcxx/include/rw/_rawiter.h:146:   instantiated from 'std::pair<_TypeT*,
int> std::get_temporary_buffer(int) [with _TypeT = int]'
> t.cpp:5:   instantiated from here
> /amd/devco/sebor/stdcxx/include/rw/_rawiter.h:131: warning: dereferencing type-punned
pointer will break strict-aliasing rules
> gcc t.o -o t -pthreads -L/build/sebor/gcc-4.1.1-12d/lib -lstd12d  -Wl,-R/build/sebor/gcc-4.1.1-12d/lib
-lsupc++ -lm 
> rm t.o

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message