Skip to content

Commit fd4780f

Browse files
committed
Stop clang-format formatting comments
1 parent 2f4c1bf commit fd4780f

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

tests/unit/string_literals.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
void foo(char *str) {}
22

33
int main() {
4-
// warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
4+
// -Wwritable-strings warning triggered
55
char *mutable_strings[] = {"a", "b", "c"};
66
const char *immutable_strings[] = {"a", "b", "c"};
77

@@ -10,6 +10,6 @@ int main() {
1010

1111
foo("world");
1212
foo(mutable_string);
13-
// This is not allowed, only string literals to char* are allowed: foo(immutable_string);
13+
// Calling foo with immutable_string is an error, not an warning
1414
return 0;
1515
}

tests/unit/string_literals_c.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
void foo(char *str) {}
22

33
int main() {
4-
// warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
54
char *mutable_strings[] = {"a", "b", "c"};
65
const char *immutable_strings[] = {"a", "b", "c"};
76

@@ -10,6 +9,6 @@ int main() {
109

1110
foo("world");
1211
foo(mutable_string);
13-
// This is not allowed, only string literals to char* are allowed: foo(immutable_string);
12+
// Calling foo with immutable_string is an error
1413
return 0;
1514
}

0 commit comments

Comments
 (0)