ros / roscpp_core

ros distribution sandbox
88 stars 116 forks source link

Use of UINT_MAX as maximum value for integers of type uint32_t #74

Closed traversaro closed 5 years ago

traversaro commented 6 years ago

In the time.cpp file, there are several points in which UINT_MAX is used as the maximum value for 32-bit unsigned integers (i.e. uint32_t):

While UINT_MAX is indeed the maximum value for 32-bit unsigned integers for the commonly used 64-bit data models (see http://www.unix.org/version2/whatsnew/lp64_wp.html , https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models ) there are a few platform for which it should be a more appropriate to use explicitly the 32-bit unsigned maximum, i.e. UINT32_MAX.

Unfortunately, I far as I understand UINT32_MAX is standard only since C++11, so I don't know a clean way to fix this using C++98 .