SmartRC-CC1101-Driver-Lib icon indicating copy to clipboard operation
SmartRC-CC1101-Driver-Lib copied to clipboard

Fix warnings found with "--warnings more"

Open Noltari opened this issue 1 year ago • 1 comments

Fix warnings found with "--warnings more":

/home/runner/Arduino/libraries/SmartRC-CC1101-Driver-Lib/ELECHOUSE_CC1101_SRC_DRV.cpp: In member function 'void ELECHOUSE_CC1101::Reset()':
/home/runner/Arduino/libraries/SmartRC-CC1101-Driver-Lib/ELECHOUSE_CC1101_SRC_DRV.cpp:149:3: error: this 'while' clause does not guard... [-Werror=misleading-indentation]
   while(digitalRead(MISO_PIN));
   ^~~~~
/home/runner/Arduino/libraries/SmartRC-CC1101-Driver-Lib/ELECHOUSE_CC1101_SRC_DRV.cpp:150:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
  digitalWrite(SS_PIN, HIGH);
  ^~~~~~~~~~~~
/home/runner/Arduino/libraries/SmartRC-CC1101-Driver-Lib/ELECHOUSE_CC1101_SRC_DRV.cpp: In member function 'void ELECHOUSE_CC1101::Split_MDMCFG1()':
/home/runner/Arduino/libraries/SmartRC-CC1101-Driver-Lib/ELECHOUSE_CC1101_SRC_DRV.cpp:983:5: error: unused variable 's2' [-Werror=unused-variable]
 int s2 = 0;
     ^~
/home/runner/Arduino/libraries/SmartRC-CC1101-Driver-Lib/ELECHOUSE_CC1101_SRC_DRV.cpp: In member function 'void ELECHOUSE_CC1101::setPA(int)':
/home/runner/Arduino/libraries/SmartRC-CC1101-Driver-Lib/ELECHOUSE_CC1101_SRC_DRV.cpp:445:5: error: 'a' may be used uninitialized in this function [-Werror=maybe-uninitialized]
 int a;
     ^
cc1plus: some warnings being treated as errors

Noltari avatar May 31 '23 16:05 Noltari

These warnings are treated as errors in my CI arduino builds (I'm not sure why and where this is configured) and now my tests fail on my main branch https://github.com/Legion2/Somfy_Remote_Lib/actions/runs/6057348260/job/16439196101?pr=31#step:3:508

Legion2 avatar Sep 02 '23 10:09 Legion2