https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106469

--- Comment #3 from Henry <hbucher at gmail dot com> ---
I agree that technically it is not UB. However I still think it is bad
practice. 

So far that single line is the only place in all libstdc++ that triggers that
undefined. 

I cannot believe that a developer consciously chose to let unsigned underflow
happen in such simple expression.

So instead of K + (M - N) why not just change it to (K + M) - N? It is such a
simple change. I have modified it and tested but not to the extent to run all
the libstdc++ unit tests.

Reply via email to