-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bugs introduced for versions of clang < 7.0
- Loading branch information
1 parent
3031696
commit 49b72b8
Showing
139 changed files
with
701 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
tests/expected_output/clang-6.0-x86_64-pc-linux-gnu/add_int_to_string.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
[1mtests/compile_time/add_int_to_string.c:4:17: [0m[0;1;35mwarning: [0m[1madding 'int' to a string does not append to the string [-Wstring-plus-int][0m | ||
tests/compile_time/add_int_to_string.c:4:17: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] | ||
printf("hello" + argc); | ||
[0;1;32m ~~~~~~~~^~~~~~ | ||
[0m[1mtests/compile_time/add_int_to_string.c:4:17: [0m[0;1;30mnote: [0muse array indexing to silence this warning[0m | ||
~~~~~~~~^~~~~~ | ||
tests/compile_time/add_int_to_string.c:4:17: note: use array indexing to silence this warning | ||
printf("hello" + argc); | ||
[0;1;32m ^ | ||
[0m[0;32m & [ ][0m | ||
^ | ||
& [ ][0m | ||
dcc explanation: Careful, you can't concatenate values and strings in C using the `+` operator, as you seem to be trying to do on line 4 of `tests/compile_time/add_int_to_string.c`. | ||
Odds are you want to provide `printf` with a format code for that value and pass that value to `printf` as an argument. | ||
|
8 changes: 4 additions & 4 deletions
8
tests/expected_output/clang-6.0-x86_64-pc-linux-gnu/array_static_illegal_index.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[1mtests/compile_time/array_static_illegal_index.c:3:2: [0m[0;1;35mwarning: [0m[1marray index 5 is past the end of the array (which contains 5 elements) [-Warray-bounds][0m | ||
tests/compile_time/array_static_illegal_index.c:3:2: warning: array index 5 is past the end of the array (which contains 5 elements) [-Warray-bounds] | ||
a[5] = 0; | ||
[0;1;32m ^ ~ | ||
[0m[1mtests/compile_time/array_static_illegal_index.c:2:2: [0m[0;1;30mnote: [0marray 'a' declared here[0m | ||
^ ~ | ||
tests/compile_time/array_static_illegal_index.c:2:2: note: array 'a' declared here | ||
int a[5]; | ||
[0;1;32m ^[0m | ||
^[0m | ||
dcc explanation: Careful, on line 3 of `tests/compile_time/array_static_illegal_index.c`, it looks like you're trying to access location 5 of `a`, which doesn't exist; `a` isn't that long. | ||
Keep in mind that arrays are 0-indexed. | ||
|
4 changes: 2 additions & 2 deletions
4
tests/expected_output/clang-6.0-x86_64-pc-linux-gnu/array_string_index.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[1mtests/compile_time/array_string_index.c:3:3: [0m[0;1;31merror: [0m[1marray subscript is not an integer[0m | ||
tests/compile_time/array_string_index.c:3:3: error: array subscript is not an integer | ||
a["0"] = 0; | ||
[0;1;32m ^~~~[0m | ||
^~~~ | ||
dcc explanation: Looks like you're trying to access an element of the array `a` on line 3 of `tests/compile_time/array_string_index.c`, but your index (`"0"`) is not of type `int`. | ||
Right now, your index is of type `string` instead. | ||
Make sure your index (the value between square brackets) is an `int`. |
4 changes: 2 additions & 2 deletions
4
tests/expected_output/clang-6.0-x86_64-pc-linux-gnu/assert_without_closing_parenthesis.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[1mtests/extracted_compile_time_tests/assert_without_closing_parenthesis.c:5:2: [0m[0;1;31merror: [0m[1munterminated function-like macro invocation[0m | ||
tests/extracted_compile_time_tests/assert_without_closing_parenthesis.c:5:2: error: unterminated function-like macro invocation | ||
assert(argc == 1; | ||
[0;1;32m ^[0m | ||
^ | ||
dcc explanation: it looks like there is a missing closing bracket on the assert on line 5 of tests/extracted_compile_time_tests/assert_without_closing_parenthesis.c |
4 changes: 2 additions & 2 deletions
4
tests/expected_output/clang-6.0-x86_64-pc-linux-gnu/assign_array_to_int.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[1mtests/extracted_compile_time_tests/assign_array_to_int.c:4:10: [0m[0;1;35mwarning: [0m[1mincompatible pointer to integer conversion assigning to 'int' from 'int [3]' [-Wint-conversion][0m | ||
tests/extracted_compile_time_tests/assign_array_to_int.c:4:10: warning: incompatible pointer to integer conversion assigning to 'int' from 'int [3]' [-Wint-conversion] | ||
a[0][0] = a[1]; | ||
[0;1;32m ^ ~~~~[0m | ||
^ ~~~~ | ||
dcc explanation: you are attempting to assign a[1] which is an array to an int variable. | ||
|
4 changes: 2 additions & 2 deletions
4
tests/expected_output/clang-6.0-x86_64-pc-linux-gnu/assign_function_to_int.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
tests/expected_output/clang-6.0-x86_64-pc-linux-gnu/assign_pointer_to_int.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[1mtests/extracted_compile_time_tests/assign_pointer_to_int.c:4:4: [0m[0;1;35mwarning: [0m[1mincompatible pointer to integer conversion assigning to 'int' from 'int *'; remove & [-Wint-conversion][0m | ||
tests/extracted_compile_time_tests/assign_pointer_to_int.c:4:4: warning: incompatible pointer to integer conversion assigning to 'int' from 'int *'; remove & [-Wint-conversion] | ||
a = &a; | ||
[0;1;32m ^ ~~[0m | ||
^ ~~ | ||
dcc explanation: you are attempting to assign &a which is not an int to an int variable. | ||
|
4 changes: 2 additions & 2 deletions
4
tests/expected_output/clang-6.0-x86_64-pc-linux-gnu/assign_to_array.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
tests/expected_output/clang-6.0-x86_64-pc-linux-gnu/assign_to_multidimensional_array.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[1mtests/extracted_compile_time_tests/assign_to_multidimensional_array.c:4:4: [0m[0;1;31merror: [0m[1marray type 'int [3][1]' is not assignable[0m | ||
tests/extracted_compile_time_tests/assign_to_multidimensional_array.c:4:4: error: array type 'int [3][1]' is not assignable | ||
a = b; | ||
[0;1;32m ~ ^[0m | ||
~ ^ | ||
dcc explanation: you are trying to assign to 'a' which is an array. | ||
You can not assign to a whole array. | ||
You can use a nested loop to assign to each array element individually. |
7 changes: 7 additions & 0 deletions
7
tests/expected_output/clang-6.0-x86_64-pc-linux-gnu/dcc-function-variable-clash.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
tests/extracted_compile_time_tests/dcc-function-variable-clash.c:4:13: error: called object type 'int' is not a function or function pointer | ||
return main(); | ||
~~~~^ | ||
dcc explanation: 'main' is the name of a variable but you are trying to call it as a function. | ||
If 'main' is also the name of a function, you can avoid the clash, | ||
by changing the name of the variable 'main' to something else. | ||
See more information here: https://comp1511unsw.github.io/dcc/dcc-function-variable-clash.html |
Oops, something went wrong.