-
Notifications
You must be signed in to change notification settings - Fork 133
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
flang2 code is terrible #1376
Comments
Classic Flang has a very long history; some of the code might have been automatically converted from another language into K&R C (C89 if we are lucky). An attempt was made to rewrite parts of it in C++ but that effort was abandoned. We do know that the code base works, works with language conformance tests and real applications, and is the basis of several commercial compilers. But if you need a code base that passes |
If you change your mind and want to help fix these compiler warnings, feel free to submit PRs! |
Why were |
@gklimowicz @pawosm-arm Any idea? |
@ppenzin it was a PGI's idea to improve the code quality: the more demanding C++ compiler in theory should expose existing flaws in the plain C code. |
What specific flaws of a C code base can be exposed by treating it as C++? Even though syntax is related, there are extra semantics in C++ which can lead to hard to follow bugs or simply heaps of warnings from what used to be perfectly fine code. |
As @pawosm-arm mentioned, this was the process we had for migrating changes from PGI Fortran to Flang (that you helped create, Petr). I haven't been with NVIDIA for more than three years now, and the commit you mentioned is over 5-1/2 years old. But my recollection was that it was made to improve the type-checking in the back-end, and possibly to improve interfacing to the LLVM code generation libraries. I am surprised that the change lost history in this repo. I thought git renames were treated better with respect to this kind of change. |
@gklimowicz History isn't lost, it is just a bit hidden. Running |
@bryanpkc Thanks for that info. I haven’t needed to do this in the past, so I appreciate knowing (a) it can be done, and (b) how. |
We all know how this code is and that there is plenty room for the improvements. Contributions are more than welcomed. |
Guys, this code is really bad quality. Someone who wrote it does not really understand how to write C/C++ code. I'm sorry to say this, but look for yourself:
Is this code really from PGI, NVIDIA and LLVM, not from a student homework? This has to be removed entirely, there is nothing to fix here.
The text was updated successfully, but these errors were encountered: