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]

Bug in GCC 7.1?


The following program gives a warning under GCC 7.1 (built on cygwin, 64 bit)
 
#include <vector>
int main()
{
    std::vector<int> c {1,2,3,0};
    while(c.size() > 0 && c.back() == 0)
    {
        auto sz = c.size() -1;
        c.resize(sz);
    }
    return 0;
}
 
$ c++7.1 -O3 tt.cxx
In Funktion »int main()«:
cc1plus: Warnung: »void* __builtin_memset(void*, int, long unsigned int)«: angegebene Größe 18446744073709551612 überschreitet maximale Objektgröße 9223372036854775807 [-Wstringop-overflow=]
 
Compiling with GCC 6.1 (c++6.1 -O3 tt.cxx) works fine.
 
Is this a problem of my program or a problem of GCC 7.1?
 
Helmut


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