ublk-org / ublksrv

ublk: userspace block device driver
MIT License
150 stars 53 forks source link

Enable more warnings on C++ code #32

Closed reubeno closed 2 years ago

reubeno commented 2 years ago

This adds additional warnings when configuring with --enable-gcc-warnings.

A few warning types were specifically disabled with TODOs; they would be best to address in separate changes.

Signed-off-by: reuben olinsky reubeno.dev@gmail.com

ming1 commented 2 years ago

The following build failure is triggered:

gcc -DHAVE_CONFIG_H -I. -Wall -Werror -Wuninitialized -Wmaybe-uninitialized -Wno-sign-compare -Wno-reorder -Wno-parentheses -Wvla -Wframe-larger-than=5000 -Wstack-usage=10000 -pthread -I./include -Wall -Werror -Wuninitialized -Wmaybe-uninitialized -Wno-sign-compare -Wno-reorder -Wno-parentheses -Wvla -Wframe-larger-than=5000 -Wstack-usage=10000 -pthread -I/root/git/liburing/src/include -g -O0 -MT demo_null-demo_null.o -MD -MP -MF .deps/demo_null-demo_null.Tpo -c -o demo_null-demo_null.o test -f 'demo_null.c' || echo './'demo_null.c cc1: error: command-line option '-Wno-reorder' is valid for C++/ObjC++ but not for C [-Werror] cc1: all warnings being treated as errors

reubeno commented 2 years ago

I missed that because I was only doing incremental builds, my apologies. I've pushed an update that just resolves all instances of that warning - largely it entailed shuffling initializers.

As far as catching build errors goes, would you be open to a PR that adds a github workflow to build the code (with warnings on) for all PRs? (CI style.)

ming1 commented 2 years ago

I missed that because I was only doing incremental builds, my apologies. I've pushed an update that just resolves all instances of that warning - largely it entailed shuffling initializers.

As far as catching build errors goes, would you be open to a PR that adds a github workflow to build the code (with warnings on) for all PRs? (CI style.)

Sure, I just don't know how to do that, can you share the steps or would you like to add the support?

Thanks,