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

libmtkfmjni: Address compiler warnings in build #13

Closed
wants to merge 1 commit into from

Conversation

ramenrolls
Copy link

@ramenrolls ramenrolls commented Jan 25, 2025

This commit addresses build failures from the -Werror flag being passed by default.

Specifically, the warnings were seen in:

  • Unused parameter 'idx' in FMR_chk_cfg_data and FMR_stop_scan functions.
  • Unused variable 'ret' in FMR_chk_cfg_data.
  • Unused function 'sig_alarm'.

To allow the build to proceed, the following compiler args are made in the libmtkfmjni makefile:

  • -Wno-error=unused-but-set-variable
  • -Wno-error=unused-parameter
  • -Wno-error=unused-function

Fixes build errors related to:

  • packages/apps/RevampedFMRadio/jni/fmr/fmr_core.cpp:67
  • packages/apps/RevampedFMRadio/jni/fmr/fmr_core.cpp:82
  • packages/apps/RevampedFMRadio/jni/fmr/fmr_core.cpp:755
  • packages/apps/RevampedFMRadio/jni/fmr/fmr_core.cpp:73

This commit addresses build failures in the JNI libs caused by compiler warnings being treated as errors due to the `-Werror` flag being passed by default. 

Specifically, the following warnings were seen in:

* Unused parameter 'idx' in `FMR_chk_cfg_data` and `FMR_stop_scan` functions. 
* Unused variable 'ret' in `FMR_chk_cfg_data`.
* Unused function 'sig_alarm'.

To allow the build to proceed, the following compiler flags have been added to the `LOCAL_CFLAGS` in the `libmtkfmjni` makefile:

* `-Wno-error=unused-but-set-variable`
* `-Wno-error=unused-parameter`
* `-Wno-error=unused-function`

These flags will instruct the compiler to treat these "issues" as warnings rather than errors, thus preventing them from halting the build process.

Unused variables and functions can often indicate potential logic errors or dead code that could impact the application's functionality or maintainability. 

Fixes build errors related to:

* packages/apps/RevampedFMRadio/jni/fmr/fmr_core.cpp:67
* packages/apps/RevampedFMRadio/jni/fmr/fmr_core.cpp:82
* packages/apps/RevampedFMRadio/jni/fmr/fmr_core.cpp:755
* packages/apps/RevampedFMRadio/jni/fmr/fmr_core.cpp:73
@iusmac
Copy link
Owner

iusmac commented Feb 10, 2025

Should be fixed with jni: Fix unused variable/function/parameter errors

@iusmac iusmac closed this Feb 10, 2025
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