WENO-OF / WENOEXT

Weighted essentially non-oscillatory library for the framework of OpenFOAM
GNU General Public License v3.0
119 stars 64 forks source link

warning: comparison of integer expressions of different signedness: #14

Closed drhcelik closed 3 years ago

drhcelik commented 3 years ago

Hello! When I am compiling on Ubuntu 20.04, I get a warning such that:

WENOBase/matrixDB.C:120:31: warning: comparison of integer expressions of different signedness: ‘std::size_t’ {aka ‘long unsigned int’} and ‘Foam::label’ {aka ‘int’} [-Wsign-compare]

What might be the reason? I think it might be safely ignored but I just wonder the reason, just out of curiosity.

JanGaertner commented 3 years ago

Hello,

it is a typical error that comes from the way the blaze matrix and OpenFOAM matrix are designed. In OpenFOAM all sizes are given with the own label type which is based on either int32_t or int64_t (depending what WM_LABEL_SIZE option you chose). In comparison the blaze matrix uses the typical C++ size_t type that converts to unsigned int. In matrixDB the OpenFOAM matrix is converted to a blaze matrix and for this a comparison of size leads then to this warning.

Summary: you can ignore it ;)

drhcelik commented 3 years ago

Thanks a lot for this explanation. I also close this issue.