Boost logo

Boost :

From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2007-11-10 08:19:07


The file boost/test/impl/debug.ipp contains the function
prepare_window_title, which contains this line (317):

::snprintf( title_str, sizeof(title_str), "%*s %ld",
dsi.binary_path.end()-it, it, dsi.pid );

There are two potential problems here.
One, the length specification of "%*s" must be an int, but the
difference_type of the iterator is ptrdiff_t, which is a long int.
That's a different size on a GCC-compiled 64-bit system and will cause
problems.
Two, is it safe to say that basic_cstring::iterator (the type of 'it')
will always be a pointer? No debug iterator will ever be used?

Sebastian Redl


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