This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

program compiled with -ftrapv aborts in std::queue<>.size()


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]