dcleblanc / SafeInt

SafeInt is a class library for C++ that manages integer overflows.
MIT License
202 stars 35 forks source link

Preprocessor macros defined in the header file should be properly prefixed to avoid naming collisions #57

Open GiovanniDicanio opened 8 months ago

GiovanniDicanio commented 8 months ago

The SafeInt.hpp header defines some preprocessor macros that could cause naming collisions, e.g.: CPLUSPLUS_98, CPLUSPLUS_11, and many others. Those preprocessor macros should have proper prefixes to avoid naming conflicts, e.g. should be renamed like SAFEINT_CPLUSPLUS_11, SAFEINT_CPLUSPLUS14, etc.

GiovanniDicanio commented 8 months ago

This code should fix the above issue (please note that the code requires more testing). SafeInt_GiovanniDicanio_2023_10_26.zip

GiovanniDicanio commented 8 months ago

Attached code with parenthesized (std::numeric_limits<T>::max)() and (std::numeric_limits<T>::min)() to fix #58 #51. (Please note that the code requires more testing). SafeInt_GiovanniDicanio_2023_10_30.zip