Skip to content

Commit d70a329

Browse files
committed
Fix Checked C error and clang warning.
- A bad merge dropped type argument required by Checked C. - clang is correctly warning about a non-string being passed to a var args print function where a string is expected. Fix this. This should be backported to the parent LLVM branch.
1 parent 47111d3 commit d70a329

File tree

1 file changed

+3
-3
lines changed
  • MultiSource/Benchmarks/Ptrdist/ks

1 file changed

+3
-3
lines changed

MultiSource/Benchmarks/Ptrdist/ks/KS-1.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ ReadNetList(_Nt_array_ptr<char> fname)
4343

4444
TRY(inFile = fopen(fname, "r"),
4545
inFile != NULL, "ReadData",
46-
"unable to open input file [%s]", inFile, 0, 0,
46+
"unable to open input file [%s]", fname, 0, 0,
4747
exit(1));
4848

4949
_Unchecked { TRY(fgets(line, BUF_LEN, inFile),
5050
sscanf((const char*)line, "%lu %lu", &numNets, &numModules) == 2, "ReadData",
51-
"unable to parse header in file [%s]", inFile, 0, 0,
51+
"unable to parse header in file [%s]", fname, 0, 0,
5252
exit(1)); }
5353

5454
for (net = 0; net < numNets; net++) {
@@ -67,7 +67,7 @@ ReadNetList(_Nt_array_ptr<char> fname)
6767
_Nt_array_ptr<char> tok = NULL;
6868
// Checked C: TODO: return bounds-safe interface being lost.
6969
while ((tok = (_Nt_array_ptr<char>) strtok(NULL, " \t\n")) != NULL) {
70-
TRY(node = calloc(1, sizeof(Module)),
70+
TRY(node = calloc<Module>(1, sizeof(Module)),
7171
node != NULL, "ReadData",
7272
"unable to allocate a module list node", 0, 0, 0,
7373
exit(1));

0 commit comments

Comments
 (0)