diff options
author | Tamar Christina <tamar.christina@arm.com> | 2020-11-17 10:14:53 +0000 |
---|---|---|
committer | Tamar Christina <tamar.christina@arm.com> | 2020-11-17 10:15:30 +0000 |
commit | 200c9e865f49255ea32d4891b746d394d156a16f (patch) | |
tree | b861e307d1b7ffc7baeb15318026d8bf3d7e71a2 /libcpp/internal.h | |
parent | 2d8b144a2a61b007f59286731275773f6e167be1 (diff) | |
download | gcc-200c9e865f49255ea32d4891b746d394d156a16f.zip gcc-200c9e865f49255ea32d4891b746d394d156a16f.tar.gz gcc-200c9e865f49255ea32d4891b746d394d156a16f.tar.bz2 |
MingW: Don't add suffix for nul device
This patch fixes an issue where on systems that are
HAVE_TARGET_EXECUTABLE_SUFFIX the driver calls convert_filename in order to
add the suffix to the filename. However while it excludes `-` it doesn't
exclude the null device. This patches changes the check to exclude anything
that is not a file by calling not_actual_file_p instead.
This also fixes a bug in not_actual_file_p which was accidentally testing
a the global variable output_file instead of the supplied argument. This
hasn't been an issue so far because because not_actual_file_p was only used
on output_file till now.
This fixes the adding of an extension to the nul device which is against
the recommendations on msdn[0] and makes it harder for the next tool in line
to detect it.
Bootstrapped Regtested on x86_64-w64-mingw32 and no issues.
Did do a bootstrap on x86_64-pc-linux-gnu but no regtest as it's not a
HAVE_TARGET_EXECUTABLE_SUFFIX system.
[0] https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
gcc/ChangeLog:
PR driver/97574
* gcc.c (convert_filename): Don't add suffix to things that are
not files.
(not_actual_file_p): Use supplied argument.
Diffstat (limited to 'libcpp/internal.h')
0 files changed, 0 insertions, 0 deletions