Return value of function might be undefined
Posted: Mon Apr 22, 2019 8:29 pm
Good day esteemed forum members
I have tried everything I can think of to get rid of the compiler warning from this function:
Warning[] F:\Projects\Alarm\18F47K40 Home Alarm.bas 955 : Return value of function 'waitForMatchingCharCount' might be undefined
I also tried
in stead of
Any suggestions, please?
I may add that the code functions as intended - its just that warning ...
Is this the latest compiler version?
Swordfish BASIC Compiler 2.2.2.5 (BETA B6) (ICC 1.1.6.4)
Regards
Bernard
I have tried everything I can think of to get rid of the compiler warning from this function:
Code: Select all
Function waitForMatchingCharCount(matchChar As Byte, matchCount As Byte = 1) As Byte
Dim c as byte
Dim charCount As Byte
charCount = 0
PIE3.7 = 0
PIR3.7 = 0
TMR3CLK = %00000100
PIR4.2 = 0
TMR3H = 0
TMR3L = 0
T3CON = %00110011
While PIR4.2 = 0 And charCount < matchCount
If PIR3.7 = 1 Then
c = RC2REG
If c = matchChar Then
charCount = charCount + 1
EndIf
EndIf
Wend
UART.Write("/wfmChar res: ",DecToStr(charCount),#13,#10)
PIE3.7 = 1
T3CON = %00000000
result = charCount
End Function
I also tried
Code: Select all
waitForMatchingCharCount = charCount
Code: Select all
result = charCount
I may add that the code functions as intended - its just that warning ...
Is this the latest compiler version?
Swordfish BASIC Compiler 2.2.2.5 (BETA B6) (ICC 1.1.6.4)
Regards
Bernard