How do I get G++ to correctly locate a file error with tabs?

22 Views Asked by At

This is a problem that happened after I upgraded my version of G++.

When I run this pragramme on Windows:

#include<cstdlib>
int main() {
    std::system("echo \t#error > a.cpp");
    std::system("g++ a.cpp");
}

It will output:

a.cpp:1:10: error: #error
    1 |         #error
      |          ^~~~~

Why is the error column that G++ gives me not correct?

(It's actually labelled with the letter 'e' in column 3,but not what it's outputting "a.cpp:1:10")


However, if I use G++ 10.3.0, the column will be correct.

How could me fix it?


This is my G++ version:

> g++ --version
g++ (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r4) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks in advance.

0

There are 0 best solutions below