TomHarte / CLK

A latency-hating emulator of: the Acorn Electron and Archimedes, Amstrad CPC, Apple II/II+/IIe and early Macintosh, Atari 2600 and ST, ColecoVision, Enterprise 64/128, Commodore Vic-20 and Amiga, MSX 1/2, Oric 1/Atmos, early PC compatibles, Sega Master System, Sinclair ZX80/81 and ZX Spectrum.
MIT License
910 stars 50 forks source link

warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits] #1359

Closed ryandesign closed 2 months ago

ryandesign commented 2 months ago

Building the latest code from the repo on Linux with cmake (which uses -Wall -Wextra) and g++ 11.4.0, I get this warning:

.../CLK/Machines/Apple/AppleIIgs/MemoryMap.hpp: In member function ‘bool Apple::IIgs::MemoryMap::is_shadowed(const Apple::IIgs::MemoryMap::Region&, uint32_t) const’:
.../CLK/Machines/Apple/AppleIIgs/MemoryMap.hpp:80:41: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
   80 |                         assert(physical >= 0 && physical <= 0xff'ffff);
      |                                ~~~~~~~~~^~~~