-
-
Notifications
You must be signed in to change notification settings - Fork 606
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 annoying warnings while building tests #976
Comments
The list of warnings during test compilation continues to grow in gcc 8.2 :-( |
Hi @nyh / @wkozaczuk , How are you doing? My Friends, doing a quick run, I've got this: /home/netto/Desktop/osv/osv-tomcat9/tests/tst-mmap.hh: In function ‘bool try_write(int ()())’: /home/netto/Desktop/osv/osv-tomcat9/tests/misc-free-perf.cc: In function ‘void test_across_core_alloc_and_free(Alloc, Dealloc)’: /home/netto/Desktop/osv/osv-tomcat9/build/release.x64/tests/tst-truncate.o: In function /home/netto/Desktop/osv/osv-tomcat9/build/release.x64/tests/tst-zfs-mount.o: In function /home/netto/Desktop/osv/osv-tomcat9/build/release.x64/tests/tst-stat.o: In function `test_mkdir_fails_if_file_exists::test_method()': /home/netto/Desktop/osv/osv-tomcat9/tests/tst-fs.hh:25: warning: the use of /home/netto/Desktop/osv/osv-tomcat9/build/release.x64/tests/misc-fs-stress.o: In function `main': /home/netto/Desktop/osv/osv-tomcat9/tests/misc-fs-stress.cc:54: warning: the use of /home/netto/Desktop/osv/osv-tomcat9/build/release.x64/tests/tst-vfs.o: In function `test_path_lookup::test_method()': /home/netto/Desktop/osv/osv-tomcat9/tests/tst-fs.hh:25: warning: the use of /home/netto/Desktop/osv/osv-tomcat9/build/release.x64/tests/tst-fallocate.o: In function /home/netto/Desktop/osv/osv-tomcat9/build/release.x64/tests/tst-fs-link.o: In function /home/netto/Desktop/osv/osv-tomcat9/build/release.x64/tests/tst-rename.o: In function `TempDir::TempDir()': /home/netto/Desktop/osv/osv-tomcat9/tests/tst-fs.hh:25: warning: the use of I hope to find some time to help with those small things, let's keep in touch! :) Kind Regards, |
Guys, How can I run a specific test? Kind Regards, |
./scripts/test.py —name tst-pthread.so
First you have to build image with all tests.
…Sent from my iPhone
On Oct 31, 2018, at 10:22, Geraldo Netto ***@***.***> wrote:
Guys,
How can I run a specific test?
eg: tst-pthread
Kind Regards,
Geraldo Netto
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks Waldek :) I think I fixed the first pthread issue I have found, hope to commit in a few minutes See You! :) |
Guys, I have created this page to document how to test |
Geraldo,
Thanks for taking on it.
Could you please prepare series of fairly small patches targeting specific
test or type of warning issue across all affected tests? So it is easier to
review.
Waldek
…On Wed, Oct 31, 2018 at 10:46 AM Geraldo Netto ***@***.***> wrote:
Guys,
I have created this page to document how to test
As I said, I still need to polish it, but it's a start
https://github.com/cloudius-systems/osv/wiki/Testing-POSIX-APIs-on-OSv
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#976 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFDSIbQJL_zGbaBeNjsCwB8YHC8FoqnLks5uqbfOgaJpZM4UQC6o>
.
|
When building tests, we get this warning: tst-mmap.hh:76:19: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 76 | char byte = **(volatile char**)&func; | ^~~~~~~~~~~~~~~~~~~~~~ I think this code was actually wrong... func is a function pointer, not a function, so its name already points to the function's code - there is no reason to take &func. I'm not even sure how this works. After this patch, the warning is gone, and the relevant test (tst-elf-permissions.so) still passes. Refs #976 Signed-off-by: Nadav Har'El <[email protected]> Message-Id: <[email protected]>
The compiler correctly warns that we can't fill 4097 bytes of an array size 4096 (=PATH_MAX). I don't know why this code had 4097 in the first place. The test still passes with this fix, and the warning is gone. Refs #976. Signed-off-by: Nadav Har'El <[email protected]> Message-Id: <[email protected]>
It is generally a bad idea to catch exceptions by value, because it forces an unnecessary copy of the caught value. It's even worse when the type is polymorphic - in that case the copy will only be a slice of the original type. This is why recent compilers started to warn when code catches a polymorphic type by value. In the specific case fixed here, the warning is spurious, because the caught exception isn't even used. But it's trivial to fix it, and get rid of one more warning during test compilation. Refs #976 Signed-off-by: Nadav Har'El <[email protected]> Message-Id: <[email protected]>
This should be the last patch addressing compiler warnings in unit tests as reported by the issue #976. Refs #976 Signed-off-by: Waldemar Kozaczuk <[email protected]> Message-Id: <[email protected]>
The last of these compilation warnings on test build were fixed by several patches by @wkozaczuk so finally closing this issue. |
We've been careful to clear any compilation warnings during the main OSv build, either by fixing the code or adding a compilation parameter to ignore specific false alarms. However, we've been less diligent in the tests ("scripts/build image=tests", or "make check") and those produce quite a number of silly warning messages during the build. With gcc 8.1.1, I see warnings while building the following tests:
Most of these warnings are silly and can be easily fixed
The text was updated successfully, but these errors were encountered: