You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2007/10/20 23:49:50 UTC

[jira] Assigned: (STDCXX-350) [gcc 4.1.1] -O2 warning: std::temporary_buffer dereferences type-punned pointer

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

Martin Sebor reassigned STDCXX-350:
-----------------------------------

    Assignee: Martin Sebor

> [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: 4.1.3, 4.1.4
>         Environment: gcc 4.1.1 -O2, Solaris 10
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>
> 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.