Skip to content
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 a bunch of warnings, add initial Github CI #167

Merged
merged 18 commits into from
Jan 31, 2023

Conversation

evelikov
Copy link
Contributor

Greetings everyone,

I was looking at some unrelated libva/nvidia-vaapi-driver related issues (regressions/crashes caused by my patches) and noticed that the build is fairly noisy, since I've got bunch of warnings enabled in CFLAGS.

Here is a handy MR that fixes them all, alongside a CI file on top so that new don't creep-in.

@evelikov
Copy link
Contributor Author

Rebased, pulling out the unrelated av1 patch.

@evelikov evelikov force-pushed the warnings branch 3 times, most recently from 913fa2a to 76bfcf9 Compare January 30, 2023 00:23
@evelikov
Copy link
Contributor Author

The correct incantation of detecting gnu_printf seems tricky - hope it's fixed now 🤞

@elFarto
Copy link
Owner

elFarto commented Jan 31, 2023

Thanks for the patch, that's a lot of clean-up work!

Looks like it's conflicting with your other PRs now that they've been merged. Can you get that cleared up? Then I can get it merged in.

The compiler throws a bunch of -Wchar-subscripts, since the default
sign of char is architecture specific. Adjust the declaration to fix
that.

Signed-off-by: Emil Velikov <[email protected]>
Compiler throws a lovely warning about it and none of the existing
drivers handle/support it - neither Mesa, i965 nor iHD

Signed-off-by: Emil Velikov <[email protected]>
Copy the unreachable() macro from Mesa and use it to silence the
compiler warnings.

Signed-off-by: Emil Velikov <[email protected]>
There are a two disabled codecs, which are partially commented out. Thus
the compiler rightfully complains about a bunch of unused-functions.

Just throw these into another segment and drop the used/retain
attributes. Thus if the compiler can decide to nuke them, yet it won't
flag (m)any warnings. Plus in case they're retained (building without
optimisations), it'll be impossible to pick them by mistake.

Signed-off-by: Emil Velikov <[email protected]>
This enables some basic compiler warnings, all of which have been
addressed with previous commits.

Signed-off-by: Emil Velikov <[email protected]>
lastSliceParamsCount is unsigned, yet we've been comparing it against
signed ints, while also initializing with signed int (buffer), which in
itself should be unsigned ... just copy unsigned a few times until the
compiler is (rightfully) happy.

Signed-off-by: Emil Velikov <[email protected]>
Bear in mind there are a ton of unused-argument warnings, many of which
noise so the warning is disabled.

Signed-off-by: Emil Velikov <[email protected]>
Annotate the local functions as static and enable the respective
warnings.

Signed-off-by: Emil Velikov <[email protected]>
... and drop initialization to O/NULL - it's the default already.

Signed-off-by: Emil Velikov <[email protected]>
Enable the warning and the respective attribute. Thus the compiler can
properly detect Wformat issues.

Signed-off-by: Emil Velikov <[email protected]>
... and enable the warnings in meson.

Signed-off-by: Emil Velikov <[email protected]>
Pointer arithmetic isn't portable nor compliant C.

Signed-off-by: Emil Velikov <[email protected]>
Quite noisy and not particularly useful warning - disable it.

Signed-off-by: Emil Velikov <[email protected]>
The latter ensures our actions are up-to date, while the former checks
that we build successfully without any errors on Ubuntu 22.04 with gcc
and clang-15.

Heavily copied from libva.

Note: the libffmpeg-nvenc-dev && libgstreamer-plugins-bad1.0-dev
dependencies have been removed, since they pull the standalone
libunwind-dev which conflicts with the pre-installed llvm one -
libunwind-14-dev.

As result the VP9 code path isn't built.

Signed-off-by: Emil Velikov <[email protected]>
@evelikov
Copy link
Contributor Author

It was a fairly minimal conflict - rebased. Thanks for the prompt replies o/

@elFarto
Copy link
Owner

elFarto commented Jan 31, 2023

Thanks for that.

@elFarto elFarto merged commit 2bb71a5 into elFarto:master Jan 31, 2023
@evelikov evelikov deleted the warnings branch January 31, 2023 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants