-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
lib/libspl/zone.c error: ISO C90 forbids mixed declarations and code #3588
Comments
There are several more in different files - not sure if it can be even viewed as "error" ... |
|
@kernelOfTruth this is a little odd because we do build all of the user space utilities as libraries as C99 so this shouldn't be a warning. Also why did you end up closing this issue? |
@behlendorf sorry, I had thought of it as a false positive due to having messed things up with the toolchain (e.g. KDE and QT on my system turned out to do things in a very weird way in combination with GCC 5.1) So I quickly closed it (it was pretty late back then - several hours after midnight if I remember correctly) and put the blame on the above mentioned issue and wanted to avoid confusion. In the end it still could be something to look into thus re-opening |
If we're building as C99, why is this a problem that needs fixing? If this is not a problem, then I'd like to close this issue. If it is agreed that this is a problem, I can take a look at this. @kernelOfTruth has a start, and it really should be trivial to fix these. |
@rlaager feel free taking a look at it I'm currently occupied otherwise I usually enable the following flags when porting patches or doing experiments on the code:
I'm mostly using gcc 4.9.4 hardened right now since a few things do not build with gcc 5.3 or 6.2 yet (also I didn't have time to test out e.g. a full system rebuild with gcc 6.2). GCC >5 is much more talkative and even pedantic (as stated above), a few of the warnings being false positives ... Thanks |
We should just close this. But for the record in user space we can build C99 without issue. However, any code which needs to run in kernel space must be C90. We've explored relaxing this but overriding the kernel build system is problematic and brittle so it's best that we update the code as needed. |
Just got this upon attempting to compile ZFS
seems like the aggressive error flags work after all 👍
The text was updated successfully, but these errors were encountered: