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/03/08 02:49:24 UTC

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

[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


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.


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

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ 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.


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

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor closed STDCXX-350.
-------------------------------

    Resolution: Fixed

Verified in a manual build with gcc 4.1.1 and gcc 3.4.6. Closing as Fixed.

> [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.


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

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ 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.