
On Thu, Jan 15, 2015 at 11:08 AM, Andrey Semashev <andrey.semashev@gmail.com> wrote:
The "globals" being shadowed are often in the unnamed namespace in user code. So they involve simple names like "n" and "str" which often clash with parameter names, but the library developer has no control over them.
But in this case the warning is spurious since the library code uses its parameters in either case.
That's an interesting point. The user can suppress the warning from VC++ by wrapping the header include: #pragma warning (push) #pragma warning (disable : 4459) #include <boost/lexical_cast.hpp> #pragma warning (pop) I suppose GCC has similar pragmas and other compilers support either the MSVC or GCC pragmas. The header itself could provide the pragma's when appropriate (i.e. the library itself not under test). --Beman
We cannot realistically protect ourselves from such shadowing clashes with the code we don't see, unless we follow STLPort route, which prepends its names with lots of underscores. I say we shouldn't try doing that.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost