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

RTC compilation should provide the correct line numbers in compile errors. #608

Closed
Robadob opened this issue Jul 28, 2021 · 0 comments · Fixed by #615
Closed

RTC compilation should provide the correct line numbers in compile errors. #608

Robadob opened this issue Jul 28, 2021 · 0 comments · Fixed by #615
Labels
enhancement RTC v2.0.0-alpha.1 Issues merged in to the 2.0.0-alpha.1 release

Comments

@Robadob
Copy link
Member

Robadob commented Jul 28, 2021

Currently line numbers are offset in compile errors, due to the injected includes.

This can be resolved by finally injecting a #line pragma, to reset the line number. I have tested that NVRTC supports this feature.

#line 1 should suffice, unless we also want to use this to rename the file to match that exported by the relevant CMake flag to solve another issue.

https://gcc.gnu.org/onlinedocs/cpp/Line-Control.html

@Robadob Robadob changed the title RTC compilation should provide the correct line numbers in errors. RTC compilation should provide the correct line numbers in compile errors. Jul 28, 2021
Robadob added a commit that referenced this issue Aug 4, 2021
See discussion in PR

#608
@Robadob Robadob mentioned this issue Aug 4, 2021
Robadob added a commit that referenced this issue Aug 13, 2021
See discussion in PR

#608
Robadob added a commit that referenced this issue Aug 13, 2021
This differs if EXPORT_RTC_SOURCES is enabled, so that line numbers are correct relative to the exported file (which contains injected includes too).

Otherwise, line number is at the start of the user defined RTC agent function string, however if the line begins with a linebreak, that opening linebreak is trimmed.

Closes #608
@Robadob Robadob linked a pull request Aug 13, 2021 that will close this issue
Robadob added a commit that referenced this issue Aug 13, 2021
This differs if EXPORT_RTC_SOURCES is enabled, so that line numbers are correct relative to the exported file (which contains injected includes too).

Otherwise, line number is at the start of the user defined RTC agent function string, however if the line begins with a linebreak, that opening linebreak is trimmed.

Closes #608
Robadob added a commit that referenced this issue Aug 14, 2021
This differs if EXPORT_RTC_SOURCES is enabled, so that line numbers are correct relative to the exported file (which contains injected includes too).

Otherwise, line number is at the start of the user defined RTC agent function string, however if the line begins with a linebreak, that opening linebreak is trimmed.

Closes #608
@ptheywood ptheywood added the v2.0.0-alpha.1 Issues merged in to the 2.0.0-alpha.1 release label Aug 16, 2021
@ptheywood ptheywood added this to the v2.0.0-alpha.1 milestone Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement RTC v2.0.0-alpha.1 Issues merged in to the 2.0.0-alpha.1 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants