Re: [PATCH] [C] Warn when calculating abs(unsigned_value)

2018-08-16 Thread Martin Sebor
On 08/16/2018 10:49 AM, Joseph Myers wrote: On Wed, 15 Aug 2018, Martin Sebor wrote: Detecting some of these bugs without too much noise would require moving the warning out of the front-end and to some later point after VRP has run. But you need the information about whether the conversion w

Re: [PATCH] [C] Warn when calculating abs(unsigned_value)

2018-08-16 Thread Joseph Myers
On Wed, 15 Aug 2018, Martin Sebor wrote: > Detecting some of these bugs without too much noise would require > moving the warning out of the front-end and to some later point > after VRP has run. But you need the information about whether the conversion was explicit or implicit. If someone does

Re: [PATCH] [C] Warn when calculating abs(unsigned_value)

2018-08-15 Thread Martin Sebor
On 08/14/2018 05:53 AM, Martin Jambor wrote: Hi, when you try compiling a call to function abs and provide an unsigned int in the argument in C++, you will get an error about ambiguous overload. In C however, it will pass without silently. The following patch adds a warning for these cases, be

Re: [PATCH] [C] Warn when calculating abs(unsigned_value)

2018-08-15 Thread Eric Gallager
On 8/14/18, Joseph Myers wrote: > On Tue, 14 Aug 2018, Martin Jambor wrote: > >> when you try compiling a call to function abs and provide an unsigned >> int in the argument in C++, you will get an error about ambiguous >> overload. In C however, it will pass without silently. The following >> p

Re: [PATCH] [C] Warn when calculating abs(unsigned_value)

2018-08-14 Thread Joseph Myers
On Tue, 14 Aug 2018, Martin Jambor wrote: > when you try compiling a call to function abs and provide an unsigned > int in the argument in C++, you will get an error about ambiguous > overload. In C however, it will pass without silently. The following > patch adds a warning for these cases, bec

[PATCH] [C] Warn when calculating abs(unsigned_value)

2018-08-14 Thread Martin Jambor
Hi, when you try compiling a call to function abs and provide an unsigned int in the argument in C++, you will get an error about ambiguous overload. In C however, it will pass without silently. The following patch adds a warning for these cases, because I think it is likely that such code does