1 Aug 02:02
Re: [PATCH]: filesystem: Shadow Variables Cause Warnings/Errors When Headers Are Not in System Path
Beman Dawes <bdawes <at> acm.org>
2008-08-01 00:02:32 GMT
2008-08-01 00:02:32 GMT
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> nuovations.com>
> ---
> --- 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
(Continue reading)
RSS Feed