質問編集履歴
2
コードの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -48,7 +48,7 @@
|
|
48
48
|
|
49
49
|
```
|
50
50
|
|
51
|
-
エラー
|
51
|
+
エラー(テストコードにconstを付けた結果)
|
52
52
|
```ここに言語を入力
|
53
53
|
fixture.c:49:29: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
|
54
54
|
ASSERT_ARR_EQ(expected, exp_len, submission, sub_len);
|
1
間違いを訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -50,92 +50,53 @@
|
|
50
50
|
|
51
51
|
エラー
|
52
52
|
```ここに言語を入力
|
53
|
-
fixture.c:49:29: warning: passing 'const int [6]' to parameter of type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
|
54
|
-
int* submission = solve(test_arr, 6, &sub_len);
|
55
|
-
^~~~~~~~
|
56
|
-
fixture.c:41:17: note: passing argument to parameter 'arrin' here
|
57
|
-
int* solve(int* arrin, size_t szin, size_t *szout);
|
58
|
-
^
|
59
|
-
fixture.c:
|
53
|
+
fixture.c:49:29: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
|
60
54
|
ASSERT_ARR_EQ(expected, exp_len, submission, sub_len);
|
61
55
|
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
62
|
-
fixture.c:
|
56
|
+
fixture.c:35:34: note: expanded from macro 'ASSERT_ARR_EQ'
|
63
57
|
printf("Expected %i\n", exp); \
|
64
58
|
~~ ^~~
|
65
|
-
fixture.c:
|
59
|
+
fixture.c:49:50: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
|
66
60
|
ASSERT_ARR_EQ(expected, exp_len, submission, sub_len);
|
67
61
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
|
68
|
-
fixture.c:
|
62
|
+
fixture.c:36:36: note: expanded from macro 'ASSERT_ARR_EQ'
|
69
63
|
printf("Submitted %i\n\n", sub); \
|
70
64
|
~~ ^~~
|
71
|
-
fixture.c:59:29: warning: passing 'const int [7]' to parameter of type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
|
72
|
-
int *submission = solve(test_arr, 7, &sub_len);
|
73
|
-
^~~~~~~~
|
74
|
-
fixture.c:41:17: note: passing argument to parameter 'arrin' here
|
75
|
-
int* solve(int* arrin, size_t szin, size_t *szout);
|
76
|
-
^
|
77
|
-
fixture.c:
|
65
|
+
fixture.c:59:29: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
|
78
66
|
ASSERT_ARR_EQ(expected, exp_len, submission, sub_len);
|
79
67
|
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
80
|
-
fixture.c:
|
68
|
+
fixture.c:35:34: note: expanded from macro 'ASSERT_ARR_EQ'
|
81
69
|
printf("Expected %i\n", exp); \
|
82
70
|
~~ ^~~
|
83
|
-
fixture.c:
|
71
|
+
fixture.c:59:50: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
|
84
72
|
ASSERT_ARR_EQ(expected, exp_len, submission, sub_len);
|
85
73
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
|
86
|
-
fixture.c:
|
74
|
+
fixture.c:36:36: note: expanded from macro 'ASSERT_ARR_EQ'
|
87
75
|
printf("Submitted %i\n\n", sub); \
|
88
76
|
~~ ^~~
|
89
|
-
fixture.c:70:29: warning: passing 'const int [4]' to parameter of type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
|
90
|
-
int *submission = solve(test_arr, 4, &sub_len);
|
91
|
-
^~~~~~~~
|
92
|
-
fixture.c:41:17: note: passing argument to parameter 'arrin' here
|
93
|
-
int* solve(int* arrin, size_t szin, size_t *szout);
|
94
|
-
^
|
95
|
-
fixture.c:
|
77
|
+
fixture.c:70:29: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
|
96
78
|
ASSERT_ARR_EQ(expected, exp_len, submission, sub_len);
|
97
79
|
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
98
|
-
fixture.c:
|
80
|
+
fixture.c:35:34: note: expanded from macro 'ASSERT_ARR_EQ'
|
99
81
|
printf("Expected %i\n", exp); \
|
100
82
|
~~ ^~~
|
101
|
-
fixture.c:
|
83
|
+
fixture.c:70:50: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
|
102
84
|
ASSERT_ARR_EQ(expected, exp_len, submission, sub_len);
|
103
85
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
|
104
|
-
fixture.c:
|
86
|
+
fixture.c:36:36: note: expanded from macro 'ASSERT_ARR_EQ'
|
105
87
|
printf("Submitted %i\n\n", sub); \
|
106
88
|
~~ ^~~
|
107
|
-
fixture.c:80:29: warning: passing 'const int [7]' to parameter of type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
|
108
|
-
int *submission = solve(test_arr, 7, &sub_len);
|
109
|
-
^~~~~~~~
|
110
|
-
fixture.c:41:17: note: passing argument to parameter 'arrin' here
|
111
|
-
int* solve(int* arrin, size_t szin, size_t *szout);
|
112
|
-
^
|
113
|
-
fixture.c:
|
89
|
+
fixture.c:80:29: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
|
114
90
|
ASSERT_ARR_EQ(expected, exp_len, submission, sub_len);
|
115
91
|
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
116
|
-
fixture.c:
|
92
|
+
fixture.c:35:34: note: expanded from macro 'ASSERT_ARR_EQ'
|
117
93
|
printf("Expected %i\n", exp); \
|
118
94
|
~~ ^~~
|
119
|
-
fixture.c:
|
95
|
+
fixture.c:80:50: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
|
120
96
|
ASSERT_ARR_EQ(expected, exp_len, submission, sub_len);
|
121
97
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
|
122
|
-
fixture.c:
|
98
|
+
fixture.c:36:36: note: expanded from macro 'ASSERT_ARR_EQ'
|
123
99
|
printf("Submitted %i\n\n", sub); \
|
124
100
|
~~ ^~~
|
125
|
-
fixture.c:130:33: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
|
126
|
-
ASSERT_ARR_EQ(expected, exp_len, submission, sub_len);
|
127
|
-
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
128
|
-
fixture.c:36:34: note: expanded from macro 'ASSERT_ARR_EQ'
|
129
|
-
printf("Expected %i\n", exp); \
|
130
|
-
~~ ^~~
|
131
|
-
fixture.c:130:54: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
|
132
|
-
ASSERT_ARR_EQ(expected, exp_len, submission, sub_len);
|
133
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
|
134
|
-
fixture.c:37:36: note: expanded from macro 'ASSERT_ARR_EQ'
|
135
|
-
printf("Submitted %i\n\n", sub); \
|
136
|
-
~~ ^~~
|
137
|
-
fixture.c:123:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
|
138
|
-
for(int i=0; i<rand_len; i++) {
|
139
|
-
~^~~~~~~~~
|
140
|
-
|
101
|
+
8 warnings generated.
|
141
102
|
```
|