Update comments in relation to implicit conversion from std::filesystem::path to std::string

There is actually no bug in MinGW. The different behaviour under Windows is
expected, because the implicit conversion there is only to std::wstring.
master
Sébastien Villemot 2023-12-08 18:39:27 +01:00
parent 4790fa00d8
commit e4b23fecb0
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
3 changed files with 10 additions and 10 deletions

View File

@ -444,9 +444,9 @@ main(int argc, char** argv)
dynareroot = dynareroot.parent_path();
// Construct basename (i.e. remove file extension if there is one)
/* Calling `string()` method on filename because of bug in GCC/MinGW 10.2
(shipped in Debian Bullseye 11), that fails to accept implicit
conversion to string from filename::path. */
/* Calling string() method on filename.stem(): not necessary on GNU/Linux and macOS because there
is an implicit conversion from filesystem:path to string (i.e. basic_string<char>), but needed
on Windows because the implicit conversion is only to wstring (i.e. basic_string<wchar_t>). */
const string basename {filename.stem().string()};
// Forbid some basenames, since they will cause trouble (see preprocessor#62)

View File

@ -34,9 +34,9 @@ macroExpandModFile(const filesystem::path& filename, const istream& modfile, boo
stringstream macro_output;
macro::Environment env = macro::Environment();
macro::Driver m;
/* Calling `string()` method on filename because of bug in GCC/MinGW 10.2
(shipped in Debian Bullseye 11), that fails to accept implicit
conversion to string from filename::path. */
/* Calling string() method on filename: not necessary on GNU/Linux and macOS because there is an
implicit conversion from filesystem:path to string (i.e. basic_string<char>), but needed on
Windows because the implicit conversion is only to wstring (i.e. basic_string<wchar_t>). */
m.parse(filename.string(), modfile, debug, defines, env, paths, macro_output);
if (save_macro)
{

View File

@ -75,10 +75,10 @@ Include::interpret(ostream& output, Environment& env, vector<filesystem::path>&
}
}
Driver m;
/* Calling `string()` method on filename and filename.stem() because of
bug in GCC/MinGW 10.2 (shipped in Debian Bullseye 11), that fails
to accept implicit conversion to string from filename::path. See
https://en.cppreference.com/w/cpp/filesystem/path/native. */
/* Calling string() method on filename: not necessary on GNU/Linux and macOS because there is
an implicit conversion from from filesystem:path to string (i.e. basic_string<char>), but
needed on Windows because the implicit conversion is only to wstring (i.e.
basic_string<wchar_t>). */
m.parse(filename.string(), incfile, false, {}, env, paths, output);
}
catch (StackTrace& ex)