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

Fix lcc compiler compile error #97

Merged
merged 2 commits into from
Aug 27, 2019
Merged

Fix lcc compiler compile error #97

merged 2 commits into from
Aug 27, 2019

Conversation

xopr
Copy link
Contributor

@xopr xopr commented Aug 27, 2019

On a clean machine, I came to the discovery that make lcc failed; it gave the following set of (similar) errors:
./build/gt1.c:3840:2: error: ‘for’ loop initial declarations are only allowed in C99 mode

After research, I came to the conclusion that either Utils/lcc/src/gt1.md violates the standard on six occasions, or the makefile needed CFLAGS=-std=c11 , similar as the root Makefile.
Also, I noted that the variable was referenced incorrectly.

This pull request should fix the compiler error (tested on RHEL 7.6, GNU Make 3.82 and gcc 4.8.5

@kervinck
Copy link
Owner

In this case, I think it's best to make it adhere to ANSI C aka C89. Because all the rest of LCC is ANSI C as well, and LCC only compiles ANSI C. What do you think?

@kervinck
Copy link
Owner

OTOH, if it works, it works... I gooi het er gewoon in!

@kervinck kervinck merged commit d28097e into kervinck:master Aug 27, 2019
@xopr
Copy link
Contributor Author

xopr commented Aug 27, 2019

Bedankt!
I like the idea of a lean/old/strict/classic compiler standard, but having a shortcut is probably not bad in the case of a (binary) tool.
Maybe it's worth having a low priority improvement task for it.

@kervinck kervinck mentioned this pull request Aug 27, 2019
@kervinck
Copy link
Owner

It's fine. There are bigger issues with LCC to worry about. I just added a line to #70 for this.

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