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

Line number logging with __LINE__ doesn't work #1

Closed
c42f opened this issue Feb 11, 2017 · 5 comments
Closed

Line number logging with __LINE__ doesn't work #1

c42f opened this issue Feb 11, 2017 · 5 comments

Comments

@c42f
Copy link
Owner

c42f commented Feb 11, 2017

As pointed out by @quinnj, @__LINE__ doesn't do what a C programmer naively expects :-/
f6db371#commitcomment-20846418

This could come from a backtrace instead, it just seems a bit excessive to invoke one to get something that could/should be inlined at the call site.

@c42f c42f changed the title Line number logging is broken Line number logging with __LINE__ doesn't work Feb 11, 2017
@quinnj
Copy link

quinnj commented Feb 12, 2017

For reference, I copped out by just requiring the line number as an input to the macro; see here

@c42f
Copy link
Owner Author

c42f commented Feb 12, 2017

Ah, that's a pity! Thanks for the xref :-)

@ihnorton has a scary looking hack that gives better results here
JuliaLang/julia#8066 (comment)

but it still doesn't do quite the right thing.

@c42f
Copy link
Owner Author

c42f commented Feb 12, 2017

Another related issue JuliaLang/julia#9577
Perhaps there's just no solution to this at this stage.

@c42f
Copy link
Owner Author

c42f commented Jun 23, 2017

This is solved in 0.7 thanks to JuliaLang/julia#21746

There is no, and will be no solution to this before 0.7 is released, by the looks of things.

@c42f c42f closed this as completed Jun 23, 2017
@c42f
Copy link
Owner Author

c42f commented Jun 29, 2017

Related PR to make this easier with Jameson's new code in 0.7 - JuliaLang/julia#22623

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

No branches or pull requests

2 participants