Bug 22678 – -verrors=context does not account for tabs when printing cursor

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-01-15T22:31:08Z
Last change time
2024-12-13T19:20:24Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
MrSmith33
Moved to GitHub: dmd#20038 →

Comments

Comment #0 by mrsmith33 — 2022-01-15T22:31:08Z
Example: --- void main() { string a = 42; // single tab at the beginning } --- Currently prints: --- test.d(2,13): Error: cannot implicitly convert expression 42 of type int to string string a = 42; // tab is printed as is ^ // prints 1 space for the source tab --- The diagnostic should instead be: --- utf8error.d(3,21): Error: cannot implicitly convert expression 42 of type int to string string a = 42; // tab is printed as is ^ // prints tab for every tab in the source line --- The issue is in this line: https://github.com/dlang/dmd/blob/1988acf9d0bedc8fe708e3e8009488e4d4f0e769/src/dmd/errors.d#L381 Currently it is: --- fputc(' ', stderr); --- but instead it should be: --- if (u == '\t') fputc('\t', stderr); else fputc(' ', stderr); --- or --- fputc(u == '\t' ? '\t' : ' ', stderr); ---
Comment #1 by dlang-bot — 2022-01-15T23:00:08Z
@MrSmith33 created dlang/dmd pull request #13537 "Fix issue 22678 - -verrors=context does not account for tabs when printing cursor" fixing this issue: - Fix issue 22678 - -verrors=context does not account for tabs when printing cursor https://github.com/dlang/dmd/pull/13537
Comment #2 by robert.schadek — 2024-12-13T19:20:24Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20038 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB