-
Notifications
You must be signed in to change notification settings - Fork 12
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
Return values are counted as globals #16
Comments
It's the same for me. Could be something wrong with the find_globals(code) function. My python understanding is very limited. At a glance, maybe there is something wrong with the expression
|
Hello! It turns out the the way ravioli counts globals is quite naive -- and likely to be quite buggy -- and also isn't correct for the way KSF is defined. What it needs to count are global usages not merely global definitions. This is a bit more complicated problem. Global definitions are not as useful because they could be anywhere, and ravioli as currently implemented is going to miss anything not defined in the file that it's processing. I'm actually currently doing a major rework to global counting to correctly count usages, so I'm not planning to specifically address this particular issue. Once I'm done with the rework everything should work more correctly (and better) but there are definitely going to be some edge cases to handle. |
Perfect! |
As an example, I have the following as the total contents of a file called sample1.c
for which the command
ravioli -f sample1.c
produces the outputbut i is declared within the scope of the function, and the line which ravioli complains about is the
return i
statement.I have found that it does not count i as global if that line is changed to
return (i);
but this is more of a hint than a workaround since ravioli is supposed to be used with existing code.Maybe this problem did not exist in earlier versions because your readme file shows FreeRTOS\tasks.c with zero globals but ravioli 0.3.0 shows 64 globals, many of which are xReturn or break
The text was updated successfully, but these errors were encountered: