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

Compilation: support backslashes in filenames when ms-extensions are enabled #512

Merged
merged 3 commits into from
Oct 2, 2023

Conversation

Vexu
Copy link
Owner

@Vexu Vexu commented Sep 29, 2023

Ticks a box in #509

@squeek502
Copy link
Contributor

squeek502 commented Sep 30, 2023

This seems to lead to an infinite loop if the #include file is not found.

// test.c
#include "missing.h"

Works fine without --emulate=msvc:

> arocc -E test.c
.\test.c:1:10: fatal error: 'missing.h' not found
#include "missing.h"
          ^

But this never terminates:

> arocc -E --emulate=msvc test.c

@Vexu Vexu force-pushed the ms-compat branch 2 times, most recently from bc7abb0 to df83410 Compare September 30, 2023 10:37
@Vexu
Copy link
Owner Author

Vexu commented Sep 30, 2023

Should work now.

@squeek502
Copy link
Contributor

squeek502 commented Sep 30, 2023

Note that \ in an include path still fails at the parsing stage on this branch (using --emulate=msvc). Example:

.\VCExplore.Rc:492:10: error: expected "FILENAME" or <FILENAME>
#include "res\VCExplore.rc2"  // non-Microsoft Visual C++ edited resources
         ^
.\VCExplore.Rc:492:15: error: extra tokens at end of macro directive
#include "res\VCExplore.rc2"  // non-Microsoft Visual C++ edited resources
              ^

@squeek502
Copy link
Contributor

Looking good, new win32-samples-rc-tests results for this branch:

33 .rc files processed with discrepancies
different .res outputs:     0
unexpected compile errors:  33
missing compile errors:     0

452 .rc files processed without discrepancies
identical .res outputs:     427
expected compile errors:    25

up from (#511 (comment)):

57 .rc files processed with discrepancies
different .res outputs:     0
unexpected compile errors:  57
missing compile errors:     0

428 .rc files processed without discrepancies
identical .res outputs:     403
expected compile errors:    25

@squeek502
Copy link
Contributor

Only 29 files left that have unexpected results:

29 .rc files processed with discrepancies
different .res outputs:     0
unexpected compile errors:  29
missing compile errors:     0

456 .rc files processed without discrepancies
identical .res outputs:     431
expected compile errors:    25

All the remaining files should be fixed by #line directives.

@Vexu Vexu merged commit 7bf3d05 into master Oct 2, 2023
3 checks passed
@Vexu Vexu deleted the ms-compat branch October 2, 2023 06:15
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.

2 participants