-
Notifications
You must be signed in to change notification settings - Fork 8
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 warnings when building with GCC #38
Conversation
fixes unknown-pragmas warning in GCC
fixes old-style-declaration warning in GCC
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
No errors on clang.
Should be more modularized but the
@Gnarus-G Compiling maccel-cli v0.2.1 (/tmp/git/maccel/cli)
warning: maccel-cli@0.2.1: Compiler version doesn't include clang or GCC: "cc" "--version"
warning: maccel-cli@0.2.1: In file included from src/../../driver/accel.h:5,
warning: maccel-cli@0.2.1: from src/libmaccel.c:1:
warning: maccel-cli@0.2.1: src/../../driver/fixedptc.h:216:3: warning: ‘fixedpt_str’ is static but used in inline function ‘fixedpt_cstr’ which is not static
warning: maccel-cli@0.2.1: 216 | fixedpt_str(A, str, max_dec);
warning: maccel-cli@0.2.1: | ^~~~~~~~~~~
warning: maccel-cli@0.2.1: src/../../driver/fixedptc.h:214:15: warning: ‘str’ is static but declared in inline function ‘fixedpt_cstr’ which is not static
warning: maccel-cli@0.2.1: 214 | static char str[25];
warning: maccel-cli@0.2.1: | ^~~ |
If you mean just the functions in the fixedpt header file, then no I can't think of a reason they "need" to be. |
fixes usage of static fixedpt functions in non-static sensitivity function warning
d272a78
to
c045d82
Compare
I figured out a different way to address point number 3 by making a separate wrapper function for the rust side; see the new commit: c045d82. This way fixes the warnings on both the C and rust sides. I'd like feedback on this cause it might be jank.
@MCPO-Spartan-117 |
I'm just gonna open this up, the code styling is up to @Gnarus-G. |
Co-authored-by: Мастер Чиф <[email protected]>
Co-authored-by: Мастер Чиф <[email protected]>
Fixing the warnings is necessary for a successful build when the kernel is built with the CONFIG_WERROR option. This option is default in at least the upstream kernel config.
This PR is marked as a draft because:
#ifdef
indriver/dbg.h
should be formatted.static
keyword from the fixedpt functions creates warnings in the rust CLI build. While it technically still works, I'm not sure how to fix these. Maybe a different approach should be taken.Changing
extern
tostatic
in the sensitivity function is an alternative fix, but it causes the CLI build to fail until changed back. Building the module withstatic
, reverting it toextern
, and then building the CLI works, if that's useful information.