-
Notifications
You must be signed in to change notification settings - Fork 88
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
Incorrectly warns about mixing code and declarations. #1229
Comments
Could you provide an example showing this message please? |
Here is an example kernel:
Which will give the compiler warning:
... which makes no sense, as OpenCL follows C99. |
Compiling a simple C code can produce the message even with C11:
For more information: llvm/llvm-project#53438 @alan-baker should we add |
Note that the behavior is the same with gcc, expect that |
I think clspv needs to add a flag internally, because it will not accept it on its own command line:
|
I don't think we want to make it configurable. Either we want to remove this warning from clspv, or we want to keep it like it is today. |
No, it is not blocking. It is just unnecessary noise. You can close it if you don't think it needs addressing. |
I think this is worth discussing. Let's wait for @alan-baker opinion before closing it. |
I generally prefer to have as few deviations from clang as possible. If anything I'd rather expose an option that can be forwarded to clang to let the user control which warnings they want. |
So, OpenCL is based on C99, so mixing code and variable declarations is perfectly acceptable.
Yet, clsvp will complain with:
warning: mixing declarations and code is incompatible with standards before C99
Is there a flag I need to provide to clspv to stop this warning?
The text was updated successfully, but these errors were encountered: