Skip to content

Commit f1f0b8b

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

2 files changed

Lines changed: 9 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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ immutable string expected =
66
Fri Apr 24 14:14:00 1992
77
`;
88

9+
import core.stdc.stdio;
10+
911
void main ()
1012
{
1113
string[string] env = [
@@ -16,5 +18,10 @@ void main ()
1618
const output = shellExpand("$OUTPUT_BASE/source_date_epoch.txt");
1719
run("$DMD -m$MODEL -o- -c $EXTRA_FILES/source_date_epoch.d", stdout, File(output, "wb"), env);
1820
const result = readText(output).filterCompilerOutput;
21+
if (result != expected)
22+
{
23+
fprintf(stderr, "result : [%.*s]\n", cast(int)result.length, result.ptr);
24+
fprintf(stderr, "expected: [%.*s]\n", cast(int)result.expected, expected.ptr);
25+
}
1926
assert(result == expected, result);
2027
}

0 commit comments

Comments
 (0)