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

Output errors so emacs can parse the line number #1494

Closed
audetto opened this issue May 9, 2021 · 8 comments
Closed

Output errors so emacs can parse the line number #1494

audetto opened this issue May 9, 2021 · 8 comments

Comments

@audetto
Copy link
Contributor

audetto commented May 9, 2021

Currently errors are written to console like this

hello.c(5): Error: Unexpected newline
hello.c(6): Error: ')' expected

which emacs does not parse.

Most compilers output it as

hello.c:6: Error: ')' expected
hello.c:6: Error: ';' expected

which can be clicked on emacs easily.
Change is trivial and I am happy to propose a PR, but I wonder if this has already been discussed in the past.

@oliverschmidt
Copy link
Contributor

oliverschmidt commented May 9, 2021

Apart from the line number notation... Are you specifically talking about Unexpected newline or is this an example for a certain class of error messages? Or are you after all "only" talking about the line number notation?

@audetto
Copy link
Contributor Author

audetto commented May 9, 2021

yes, just the file:line notation that emacs accepts by default.
I am sure one can configure emacs to parse file(line) but patching error.c seems much simpler and portable solution.

fprintf (stderr, "%s(%u): Fatal: ", FileName, LineNum);

I see other tools with the same syntax (ca65), but I have only used cc65 so far.

@oliverschmidt
Copy link
Contributor

oliverschmidt commented May 9, 2021

As far as I understand you'd like to see cc65 conform (more) to https://www.gnu.org/prep/standards/html_node/Errors.html

I'm personally open for a change - but it needs to include all parts of the cc65 tool chain.

@audetto
Copy link
Contributor Author

audetto commented May 9, 2021

yes, I agree on both points.

@oliverschmidt
Copy link
Contributor

I suggest that we wait a bit if there are strong opposite opinions. If there aren't, I'm willing to merge a PR consistently changing the syntax.

@mrdudz
Copy link
Contributor

mrdudz commented May 9, 2021

This has been bothering me recently as well, my editor of choice also likes file:line better - so +1 for changing it :)

@spiro-trikaliotis
Copy link

vim recognizes both formats (just tested), so I have no objections. :)

@audetto
Copy link
Contributor Author

audetto commented May 30, 2021

Thank you guys.
This is done now,

@audetto audetto closed this as completed May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants