jingoro2112 / wrench

practical embedded script interpreter
MIT License
106 stars 9 forks source link

WRarray<>::alloc compilation warnings #10

Closed schaban closed 1 year ago

schaban commented 1 year ago

When compiling with newer GCC versions (i.e. 12 or 13), a warning about exeeding maximum allocation size is produced every time WRarray<> is instantiated. The issue is here, in the alloc method: https://github.com/jingoro2112/wrench/blob/91b158bb3735a88e5ebd591f5b05fde341acac33/src/wrench.cpp#L123 (Happens with g++-11 too, but the warning only displayed once.) It's possible to suppress these numerous warnings with "-Wno-alloc-size-larger-than", but perhaps it's better to just change the type of newSize to "unsigned int".

jingoro2112 commented 1 year ago

I quite agree, this change has been made and pushed.