Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: The warnings are erroneous as far as i can see, so tweak things to avoid. The (unsigned int) cast is to avoid passing -1 to a size_t time. This was triggered in gcc8's lto build only, giving: caffe2/aten/src/TH/generic/THTensor.cpp: In function ‘THFloatTensor_squeeze1d’: lto1: error: ‘__builtin_memset’ specified size 18446744073709551608 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] In function ‘newImpl’, inlined from ‘operator new’ at common/memory/OperatorOverride.cpp:86:23, inlined from ‘allocate’ at third-party-buck/platform007/build/libgcc/include/c++/7.3.0/ext/new_allocator.h:111:0, inlined from ‘allocate’ at third-party-buck/platform007/build/libgcc/include/c++/7.3.0/bits/alloc_traits.h:436:0, inlined from ‘_M_allocate’ at third-party-buck/platform007/build/libgcc/include/c++/7.3.0/bits/stl_vector.h:172:0, inlined from ‘_M_default_append’ at third-party-buck/platform007/build/libgcc/include/c++/7.3.0/bits/vector.tcc:571:0, inlined from ‘resize’ at third-party-buck/platform007/build/libgcc/include/c++/7.3.0/bits/stl_vector.h:671:0, inlined from ‘THTensor_resizeDim’ at caffe2/aten/src/TH/THTensor.hpp:123:0, inlined from ‘THFloatTensor_squeeze1d.part.198’ at caffe2/aten/src/TH/generic/THTensor.cpp:429:0, inlined from ‘THFloatTensor_squeeze1d’: common/memory/OperatorOverride.cpp:86:23: error: argument 1 value ‘18446744073709551608’ exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=] void* ptr = malloc(size); Reviewed By: soumith Differential Revision: D9568621 fbshipit-source-id: 4569a4be897d669caa3f283f4b84ec829e8d77ad
- Loading branch information