Whole file
terryyin/lizard
The author described this change as “fix: Do not count `void` as a parameter (C/C++)”. It counts as a record because the check below fails on the code as it stood at 3c4488aed and passes on 9cff977ef, with nothing else changed between the two runs.
Projectterryyin/lizard
Fix saved2023-03-17
Sharing licenceMIT · LICENSE.txt
Change size+2 −1
What the code was meant to do, written into the code itself as a save note
fix: Do not count `void` as a parameter (C/C++)
The change
| 196 | 196 | else: | |
| 197 | 197 | self.next(self._state_global) | |
| 198 | 198 | elif len(self.bracket_stack) == 1: | |
| 199 | - | self.context.parameter(token) | |
| 199 | + | if token != 'void': # void is a reserved keyword, meaning no parameters | |
| 200 | + | self.context.parameter(token) | |
| 200 | 201 | return | |
| 201 | 202 | self.context.add_to_long_function_name(token) | |
| 202 | 203 |
The check that tells the two apart
fail→pass·test/test_languages/testCAndCPP.py::Test_c_cpp_lizard::test_function_with_no_param_void
Check file test/test_languages/testCAndCPP.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it3c4488aed0e5b737486b5ff30b91f2747f904250
Broken version dated2023-02-27
Modulelizard_languages.clike
Units changedCLikeStates
Fingerprint87aa5de7a4308814
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in terryyin/lizard
- 2026-08-08fix(java): do not report control structures as methods
- 2026-07-02HalsteadClassifier
- 2026-07-02fix(csv): emit columns for extensions with multiple FUNCTION_INFO fields
- 2026-06-15fix(golike): register generic functions with [...] type params
- 2026-06-15fix(java): enhance parsing of generic and qualified type names in anonymous classes
- 2026-06-11fix(script): stop a '#' comment continuing past a trailing backslash (#317)