This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
program compiled with -ftrapv aborts in std::queue<>.size()
- From: Mathieu Malaterre <mathieu dot malaterre at kitware dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 27 Aug 2004 18:41:33 -0400
- Subject: program compiled with -ftrapv aborts in std::queue<>.size()
- Organization: Kitware Inc.
Hello,
I tried to compile one of my program using -ftrapv but it fails on
std::vector<>.size()
Looking on the web I found:
http://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg01623.html
g++ -Wall -W -g -ftrapv -save-temps -v example.cc
#include <queue>
#include <cstdio>
typedef struct { int some_num; char* some_str; } my_struct1;
typedef struct { int some_other_num; my_struct1 s; } my_struct2;
int
main()
{
std::queue<my_struct2> my_queue;
if (my_queue.size() == 0)
std::printf( "things work as expected\n" );
}
Is this fix somewhere ? Does the code works on any gcc flavor ? If yes
which one ?
Thanks a lot
Mathieu