Блог пользователя yangchang

Автор yangchang, история, 10 месяцев назад, По-английски

When I try to compile such a programme:

	#error //there is a tab before "#error"

G++ will report an error:

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

However, I'm using tab indentation, which I think is G++ converting tabs to 8 spaces!

that is my 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.

I tried previous versions of G++, at least on 10.*. * version, it is positioned correctly.

I need G++ to position it correctly, how do I fix it?

Please don't suggest I use space indentation

  • Проголосовать: нравится
  • +16
  • Проголосовать: не нравится

»
10 месяцев назад, # |
  Проголосовать: нравится -10 Проголосовать: не нравится

use space indentation, if u don't wanna, go to ur editor settting(even vim has it), and change tab to be configured as 2 spaces