libstdc++: Refactor loops in std::__platform_semaphore
[official-gcc.git] / gcc / diagnostic-highlight-colors.h
blob66acfc8e81451656ff6a0b14fedb1c41c61296e3
1 /* Symbolic names for highlighting colors in diagnostics.
2 Copyright (C) 2024 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_DIAGNOSTIC_HIGHLIGHT_COLORS_H
21 #define GCC_DIAGNOSTIC_HIGHLIGHT_COLORS_H
23 /* Symbolic names for highlight colors in diagnostics, so that e.g.
26 warning: format `%i' expects argument of type `int',
27 but argument 2 has type `const char *' [-Wformat=]
28 279 | printf("hello " INT_FMT " world", msg);
29 | ^~~~~~~~ ~~~
30 | |
31 | const char *
32 note: format string is defined here
33 278 | #define INT_FMT "%i"
34 | ~^
35 | |
36 | int
37 | %s
39 we can refer to the color of "int" as highlight_colors::expected
40 and the color of "const char *" as highlight_colors::actual
41 to help get consistent contrasting colorization, both for the types
42 within the diagnostic messages, and the underlined ranges. */
44 namespace highlight_colors {
46 /* Color names for expressing "expected" vs "actual" values. */
47 extern const char *const expected;
48 extern const char *const actual;
50 /* Color names for expressing "LHS" vs "RHS" values in a binary operation. */
51 extern const char *const lhs;
52 extern const char *const rhs;
54 } // namespace highlight_colors
56 #endif /* ! GCC_DIAGNOSTIC_HIGHLIGHT_COLORS_H */