Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2006-07-27 20:19:38


On Thu, 27 Jul 2006 14:23:31 -0500, Rene Rivera
<grafikrobot_at_[hidden]> wrote:

>It's the false negatives that are worrisome. For example:
>
>const char * x = "//foo"; int x = min(10,20);
>
>Not that I think anyone would write such code. But strange things do
>happen :-)

Yep.

>> In short we wanted them to be just
>> more accurate than they are(n't) now.
>
>OK. So you're saying we can make the comments conform to something the
>inspection program will understand?

I was basically thinking out loud, trying to find a solution. I
considered implementing <boostinspect:nominmax>,
</boostinspect:nominmax> for instance. But I find it a bit "heavy".
Perhaps we can ask developers to write "Min" in comments, with an
uppercase 'm'...

>[...]
>I guess you would have to be extremely careful, and especially limiting,
>with the regex to have some degree of confidence false negatives don't
>occur.

Yes, that's true, though the current implementation isn't free from
problems in that regard.

 #define BOOST_MY_LIB_SMALLEST min

 BOOST_MY_LIB_SMALLEST(x, y) // no problem detected here

>> PS: did you read my suggestion about commit triggers?
>
>I don't remember reading it. But I do remember that was suggested some
>time ago regarding inspection. I think I mentioned some problems with
>that back then ;-)

Hmm... I'll search in the mailing list archives :-)

--
[ Gennaro Prota, C++ developer for hire ]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk