Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
9.1 Variable may not have been initialized
#5
You may have to write your code differently and less complex.

1. The first IF doesn't perform a real test. Actually you're only test that the variable is not empty, instead of "== true/false/on/off/etc .
2. For the second IF, you know that the compiler will generate/use temporary variables/registers to store temporary test results.
My opinion is: Do it yourself :). Create local variables to store your checks.
Small tasks are easier to read/maintain/debug/optimize ^^

One example:
Code:
..(vF_mcms_fl_on((tm_uint8)V_FLONCMD_ACK)) || (msg_info.pmcu_state ==  LDF_MASSSQC_STATE_ACTIVE)...

You're comparing return of a function with the result of a test.
i assume that the result of the function, even if you define a boolean type, is not the same type of the "==" test result...
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)