Boost logo

Boost Users :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2008-07-31 20:02:32


Grant Erickson wrote:
> In working through cross-compilation issues with boost, particularly the
> filesystem library, I discovered the following error reproduced with the
> following test case with both boost 1.34.1 and 1.35.0:
>
> FAILS:
> echo "#include <boost/filesystem.hpp>\nint main (void) { return (0);
> }" | g++ -o test -I/${BuildRoot}/results/boost/include -Werror -Wall
> -Wshadow -x c++ -
>
> PASSES:
> echo "#include <boost/filesystem.hpp>\nint main (void) { return (0);
> }" | g++ -o test -I/usr/include -Werror -Wall -Wshadow -x c++ -
>
> The failing case complains about 'what', 'path1' and 'path2' argument
> shadowing in boost/filesystem/path.hpp with respect to like-named member
> functions.
>
> Since GCC does not enforce warning options on headers in /usr/include, this
> only shows up when building against a boost installation outside
> /usr/include, as in the above failure example.
>
> The patch to address this is:
>
> Signed-off-by: Grant Erickson <gerickson_at_[hidden]>
> ---
> --- boost_1_35_0/boost/filesystem/path.hpp 2008-07-30 16:54:53.000000000
> -0700
> +++ boost_1_35_0/boost/filesystem/path.hpp.N 2008-07-30
> 16:59:42.000000000 -0700
> @@ -577,23 +577,23 @@
> // BOOST_FILESYSTEM_DECL version works for VC++ but not GCC. Go
> figure!
> inline
> const char * what( const char * sys_err_what,
> - const path & path1, const path & path2, std::string & target )
> + const path & path1_arg, const path & path2_arg, std::string &
> target )
> {
> try
> {
> if ( target.empty() )
> {
> target = sys_err_what;
> - if ( !path1.empty() )
> + if ( !path1_arg.empty() )
> {
> target += ": \"";
> - target += path1.file_string();
> + target += path1_arg.file_string();
> target += "\"";
> }
> - if ( !path2.empty() )
> + if ( !path2_arg.empty() )
> {
> target += ", \"";
> - target += path2.file_string();
> + target += path2_arg.file_string();
> target += "\"";
> }
> }

I've applied this set of changes. The others had already been made.

Thanks,

--Beman


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net