Skip to content

Commit 4ba5064

Browse files
committed
pragmasem.d: change stderr to eSink
1 parent 579fe56 commit 4ba5064

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

compiler/src/dmd/pragmasem.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ private bool pragmaMsgSemantic(Loc loc, Scope* sc, Expressions* args)
442442
if (expressionsToString(buf, sc, args, loc, "while evaluating `pragma(msg, %s)`", false))
443443
return false;
444444

445-
buf.writestring("\n");
446-
fprintf(stderr, "%s", buf.extractChars);
445+
auto eSink = global.errorSink;
446+
eSink.message(Loc.init, "%s", buf.extractChars);
447447
return true;
448448
}
449449

compiler/test/dshell/issue20444_SOURCE_DATE_EPOCH.d

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,11 @@ void main ()
1616
const output = shellExpand("$OUTPUT_BASE/source_date_epoch.txt");
1717
run("$DMD -m$MODEL -o- -c $EXTRA_FILES/source_date_epoch.d", stdout, File(output, "wb"), env);
1818
const result = readText(output).filterCompilerOutput;
19+
if (result != expected)
20+
{
21+
import core.stdc.stdio : fprintf, stderr;
22+
fprintf(stderr, "result : [%.*s]\n", cast(int)result.length, result.ptr);
23+
fprintf(stderr, "expected: [%.*s]\n", cast(int)result.expected, expected.ptr);
24+
}
1925
assert(result == expected, result);
2026
}

0 commit comments

Comments
 (0)