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

arocc does not behave as expected during errors if -E (preprocess only) is set #554

Closed
squeek502 opened this issue Nov 12, 2023 · 0 comments · Fixed by #555
Closed

arocc does not behave as expected during errors if -E (preprocess only) is set #554

squeek502 opened this issue Nov 12, 2023 · 0 comments · Fixed by #555
Labels
bug Something isn't working

Comments

@squeek502
Copy link
Contributor

squeek502 commented Nov 12, 2023

test.c:

#INCLUDE "invalid"

Built with -Doptimize=ReleaseFast, the preprocessed output is printed and a 0 exit code is returned:

> arocc -E test.c
.\test.c:1:1: error: invalid preprocessing directive
#INCLUDE "invalid"
^
1 error generated.
# 1 "test.c" 1
# 1 "<builtin>" 1
# 186 "<builtin>"
# 1 "<command line>" 1
# 1 "test.c" 2

> echo %errorlevel%
0

Built with -Doptimize=Debug, the preprocessed output is printed and a 1 exit code is returned:

> arocc -E test.c
.\test.c:1:1: error: invalid preprocessing directive
#INCLUDE "invalid"
^
1 error generated.
# 1 "test.c" 1
# 1 "<builtin>" 1
# 186 "<builtin>"
# 1 "<command line>" 1
# 1 "test.c" 2

> echo %errorlevel%
1

Expected behavior (any optimize mode):

> arocc -E test.c
.\test.c:1:1: error: invalid preprocessing directive
#INCLUDE "invalid"
^
1 error generated.

> echo %errorlevel%
1

Without -E, the expected behavior is present:

> arocc test.c
.\test.c:1:1: error: invalid preprocessing directive
#INCLUDE "invalid"
^
1 error generated.

> echo %errorlevel%
1
@squeek502 squeek502 changed the title arocc does not exit with non-zero exit code on errors if -E (preprocess only) is set arocc does not behave as expected during errors if -E (preprocess only) is set Nov 12, 2023
squeek502 added a commit to squeek502/preresinator that referenced this issue Nov 12, 2023
squeek502 added a commit to squeek502/preresinator that referenced this issue Nov 12, 2023
squeek502 added a commit to squeek502/preresinator that referenced this issue Nov 12, 2023
@Vexu Vexu added the bug Something isn't working label Nov 12, 2023
@Vexu Vexu closed this as completed in #555 Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants