Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 5879 - Not all frontend errors use stderr #742

Merged
merged 1 commit into from
Mar 12, 2012

Conversation

yebblies
Copy link
Member

Use fprintf(stderr) in iasm.c, and stop using root::error in the frontend. Most cases are obvious mistakes where code has been refactored into free functions and ended up calling error without a loc.
This makes all frontend errors correctly print to stdmsg (stderr) and fixes five unreported 'no line number' bugs.
Removing error/warning from the root headers prevents these cases from creeping back in.

http://d.puremagic.com/issues/show_bug.cgi?id=5879

@WalterBright
Copy link
Member

fails autotester

Use fprintf(stderr) in iasm.c, and stop using root::error in the frontend. Most cases are obvious mistakes where code has been refactored into free functions and ended up calling error without a loc.
This makes all frontend errors correctly print to stdmsg (stderr) and fixes five unreported 'no line number' bugs.
Removing error/warning from the root headers prevents these cases from creeping back in.
@yebblies
Copy link
Member Author

Missed one non-windows error. Should be good now.

@@ -32,9 +32,6 @@

int bstrcmp(unsigned char *s1, unsigned char *s2);
char *bstr2str(unsigned char *b);
void error(const char *format, ...);
void error(const wchar_t *format, ...);
void warning(const char *format, ...);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always hated these guys, and tried to get rid of them once before. I did a big purge of all calls to them at one stage, but they keep creeping back.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think about half the no line number bugs have been caused by these, with the rest being generated code that doesn't bother propagating the loc.

WalterBright added a commit that referenced this pull request Mar 12, 2012
Issue 5879 - Not all frontend errors use stderr
@WalterBright WalterBright merged commit e2a2f7e into dlang:master Mar 12, 2012
WalterBright added a commit that referenced this pull request Mar 12, 2012
braddr pushed a commit to braddr/dmd that referenced this pull request Oct 22, 2012
Fix Issue 8516 - std.string.representation works incorrect for shared(const(T)) types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants