-fsanitize=nonnull-attribute failing on empty container

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is this is a known problem?

-------
#include <vector>

int main()
{
   std::vector<unsigned> a;
   std::vector<unsigned> b;
   return a == b;
}
---------

$ g++ -fsanitize=nonnull-attribute empty_vectors.cpp
$ /a.out
usr/include/c++/5.1.1/bits/stl_algobase.h:825:28: runtime error: null
pointer passed as argument 1, which is declared to never be null
/usr/include/c++/5.1.1/bits/stl_algobase.h:825:28: runtime error: null
pointer passed as argument 2, which is declared to never be null

$ g++ --version
g++ (GCC) 5.1.1 20150422 (Red Hat 5.1.1-1)
(fc22)

I got the same with:
$ /opt/gcc/gcc-5/bin/g++ --version
g++ (GCC) 5.1.1

-- 
        Lgb




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux