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

'for' loop initial declarations in wfcomman.c:538:5 #158

Closed
clzls opened this issue May 3, 2018 · 5 comments
Closed

'for' loop initial declarations in wfcomman.c:538:5 #158

clzls opened this issue May 3, 2018 · 5 comments

Comments

@clzls
Copy link
Contributor

clzls commented May 3, 2018

'for' loop initial declarations are only allowed in C99 mode. So maybe we should use option -std=c99 or -std=gnu99 in Makefile?
In my opinion it's more like a "modern" C++ style of coding, not a style decades ago. (for example before 90s)

PS. I'm using mingw32-gcc (GCC) 4.7.2, a rather old version(I thought it may work for these codes over 20 years old...). After bumping into "internal error" in VS2017, I tried MinGW but I still bumped into hundreds of lines of errors and warnings. Maybe it's all my fault...

@DBJDBJ
Copy link

DBJDBJ commented May 7, 2018

Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26132 for x86
for C code, compiler "default option" is C99
There is no /std:c99 option
AFAIK. There is no way to dictate which exact C option one wants to use.
This behavior is one of "compiler default" options. Of which alas, there is no official list ...

@DBJDBJ
Copy link

DBJDBJ commented May 7, 2018

Also there is no __STDC_VERSION__ predefined macro.
So using cl.exe one can not check grammatically which C version is in use.
Like here for example.

@clzls clzls mentioned this issue May 9, 2018
@clzls
Copy link
Contributor Author

clzls commented May 9, 2018

@DBJDBJ Or maybe we can just review all the code to satisfy C90 and make VS2010 happy(#165 )?

@DBJDBJ
Copy link

DBJDBJ commented May 9, 2018

@clzls AFAIK it is Visual Studio "the latest" ... I have unleashed code analyzer on winfile and that has revealed itself as a very good method. But this is going to be one very long task. I assume the question is how to manage it. This is all for x86 builds.

x64? Just switching to that mode unleashes ocean of warnings and few errors, too. The process of removing them (for me at least) will be very close to rewrite ...

@clzls
Copy link
Contributor Author

clzls commented May 10, 2018

As Craig said in #165 , let's stick with modern compilers and forget my mingw32-gcc (GCC) 4.7.2 now. So I will close this issue.
For x64 ... maybe we can put it aside and focus on core codes ...

@clzls clzls closed this as completed May 10, 2018
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

No branches or pull requests

2 participants