Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

expander.py: trace line numbers back to the original source file #171

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

Merged
yosupo06 merged 1 commit into atcoder:master from ssvb:origname
Jun 19, 2024

Conversation

Copy link
Contributor

@ssvb ssvb commented Dec 14, 2023
edited
Loading

Using the "#line" directives, it's possible to allow compilers to report line numbers from the original source file. At least GCC and Clang support this. It's useful for tracing the compilation error locations back to the original file. Example:

 #include <iostream>
 #include <atcoder/lazysegtree>
 int main() {
 lazy_segtree<S, op, e, F, mapping, composition, id> seg(arr);
 }

== The current default behaviour: ==

$ ./expander.py example.cpp
$ g++ combined.cpp
combined.cpp: In function ‘int main()’:
combined.cpp:263:3: error: ‘lazy_segtree’ was not declared in this
 scope; did you mean ‘atcoder::lazy_segtree’?

== With the new '--origname' option: ==

$ ./expander.py --origname=example.cpp example.cpp
$ g++ combined.cpp
example.cpp: In function ‘int main()’:
example.cpp:4:3: error: ‘lazy_segtree’ was not declared in this
 scope; did you mean ‘atcoder::lazy_segtree’?

Using the "#line" directives, it's possible to allow compilers to
report line numbers from the original source file. At least GCC
and Clang support this. It's useful for tracing the compilation
error locations back to the original file. Example:
 #include <iostream>
 #include <atcoder/lazysegtree>
 int main() {
 lazy_segtree<S, op, e, F, mapping, composition, id> seg(arr);
 }
== The current default behaviour: ==
$ ./expander.py example.cpp
$ g++ combined.cpp
combined.cpp: In function ‘int main()’:
combined.cpp:263:3: error: ‘lazy_segtree’ was not declared in this
 scope; did you mean ‘atcoder::lazy_segtree’?
== With the new '--origname' option: ==
$ ./expander.py --origname=example.cpp example.cpp
$ g++ combined.cpp
example.cpp: In function ‘int main()’:
example.cpp:4:3: error: ‘lazy_segtree’ was not declared in this
 scope; did you mean ‘atcoder::lazy_segtree’?
@yosupo06 yosupo06 merged commit bc63fe9 into atcoder:master Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@yosupo06 yosupo06 yosupo06 approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /