> > What about using the check_add_overflow() macro? > > I like the macro. It seems to have plenty of users. > > Linke Li, what do you think? If you like, please send another path > using the macro as suggested by Dan. Thanks for Dan's advice. I have tested this macro in gcc-9 and clang-14, it can work well in both compilers and regardless of whether "-fno-strict-overflow" is added or not. I will send a new patch. Best Regards