Opened 15 years ago

Closed 15 years ago

#1283 closed Bugs (fixed)

unsigned filesystem::system_error_type passed a negative value on windows

Reported by: lazalong@… Owned by: Beman Dawes
Milestone: Boost 1.35.0 Component: filesystem
Version: Boost 1.34.1 Severity: Cosmetic
Keywords: Cc:

Description

On windows in path.hpp system_error_type is defined as an unsigned:

# ifdef BOOST_WINDOWS_API
    typedef unsigned system_error_type;

    BOOST_FILESYSTEM_DECL
    errno_type lookup_errno( system_error_type sys_err_code );
# else
    typedef int system_error_type;

    inline errno_type lookup_errno( system_error_type sys_err_code )
      { return sys_err_code; }
# endif

This will cause warnings with mingw because in conveniance.hpp a negative value is assigned to it in the method create_directories on line 44-47:

           if ( !ph.empty() && !is_directory(ph) )
               boost::throw_exception( basic_filesystem_error<Path>(
                 "boost::filesystem::create_directories", ph, -1 ) );

Here is the warning message:

../../include/boost/filesystem/convenience.hpp: In function `bool boost::filesystem::create_directories(const Path&)':
../../include/boost/filesystem/convenience.hpp:46: warning: passing negative value `-0x000000001' for converting 3 of `boost::filesystem::basic_filesystem_error<Path>::basic_filesystem_error(const std::string&, const Path&, boost::filesystem::system_error_type) [with Path = boost::filesystem::path]'

Change History (1)

comment:1 by Beman Dawes, 15 years ago

Milestone: To Be DeterminedBoost 1.35.0
Resolution: fixed
Severity: ProblemCosmetic
Status: newclosed

That particular warning has disappeared in the SVN trunk HEAD due to a prior code change. I did, however, increase the warning level on my development platform and then clear the half-dozen or so other warning messages that turned up.

Thanks,

--Beman

Note: See TracTickets for help on using tickets.