{
"ldblib.c": [
{
"column": 29,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 37,
"message": "Implicit boolean test on 'lua_checkstack(L1, n)'. May be unclear what constitutes success or failure.",
"rule_id": "EXP20-C",
"severity": "Medium",
"suggestion": "Use explicit test: lua_checkstack(L1, n) == 0 or lua_checkstack(L1, n) != 0 depending on success convention"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 153,
"message": "Variable 'L1' is initialized but never modified, consider const-qualifying it",
"rule_id": "DCL00-C",
"severity": "Medium",
"suggestion": "Add 'const' qualifier: const L1 = ..."
},
{
"column": 43,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 154,
"message": "Variable 'arg' is used uninitialized",
"rule_id": "EXP33-C",
"severity": "High",
"suggestion": "Initialize 'arg' before use, e.g., at its declaration"
},
{
"column": 43,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 154,
"message": "Signed integer addition 'arg+2' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 39,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 156,
"message": "Signed integer addition 'arg + 2' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 25,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 157,
"message": "Signed integer addition 'arg + 1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 22,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 159,
"message": "Signed integer addition 'arg + 1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 9,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 163,
"message": "Implicit boolean test on 'lua_getstack(L1, (int)luaL_checkinteger(L, arg + 1), &ar)'. May be unclear what constitutes success or failure.",
"rule_id": "EXP20-C",
"severity": "Medium",
"suggestion": "Use explicit test: lua_getstack(L1, (int)luaL_checkinteger(L, arg + 1), &ar) == 0 or lua_getstack(L1, (int)luaL_checkinteger(L, arg + 1), &ar) != 0 depending on success convention"
},
{
"column": 53,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 163,
"message": "Signed integer addition 'arg + 1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 29,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 169,
"message": "Signed integer addition 'arg+2' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 14,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 171,
"message": "Passing potentially null pointer 'options' to function",
"rule_id": "EXP34-C",
"severity": "High",
"suggestion": "Check if 'options' is not NULL before passing to function"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 173,
"message": "Passing string literal to function 'lua_setfield' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 174,
"message": "Passing string literal to function 'settabss' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 175,
"message": "Passing string literal to function 'settabsi' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 176,
"message": "Passing string literal to function 'settabsi' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 177,
"message": "Passing string literal to function 'settabss' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 180,
"message": "Passing string literal to function 'settabsi' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 182,
"message": "Passing string literal to function 'settabsi' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 183,
"message": "Passing string literal to function 'settabsi' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 184,
"message": "Passing string literal to function 'settabsb' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 187,
"message": "Passing string literal to function 'settabss' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 188,
"message": "Passing string literal to function 'settabss' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 191,
"message": "Passing string literal to function 'settabsi' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 192,
"message": "Passing string literal to function 'settabsi' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 195,
"message": "Passing string literal to function 'settabsb' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 196,
"message": "Passing string literal to function 'settabsi' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 208,
"message": "Variable 'L1' is initialized but never modified, consider const-qualifying it",
"rule_id": "DCL00-C",
"severity": "Medium",
"suggestion": "Add 'const' qualifier: const L1 = ..."
},
{
"column": 40,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 209,
"message": "Variable 'arg' is used uninitialized",
"rule_id": "EXP33-C",
"severity": "High",
"suggestion": "Initialize 'arg' before use, e.g., at its declaration"
},
{
"column": 40,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 209,
"message": "Signed integer addition 'arg + 2' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 25,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 210,
"message": "Signed integer addition 'arg + 1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 22,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 211,
"message": "Signed integer addition 'arg + 1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 43,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 218,
"message": "Signed integer addition 'arg + 1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 31,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 220,
"message": "Signed integer addition 'arg+1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 240,
"message": "Variable 'L1' is initialized but never modified, consider const-qualifying it",
"rule_id": "DCL00-C",
"severity": "Medium",
"suggestion": "Add 'const' qualifier: const L1 = ..."
},
{
"column": 41,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 242,
"message": "Variable 'arg' is used uninitialized",
"rule_id": "EXP33-C",
"severity": "High",
"suggestion": "Initialize 'arg' before use, e.g., at its declaration"
},
{
"column": 41,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 242,
"message": "Signed integer addition 'arg + 1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 40,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 243,
"message": "Signed integer addition 'arg + 2' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 29,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 245,
"message": "Signed integer addition 'arg+1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 20,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 246,
"message": "Signed integer addition 'arg+3' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 17,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 247,
"message": "Signed integer addition 'arg+3' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 297,
"message": "Function returns pointer to local variable 'id' with automatic storage duration",
"rule_id": "DCL30-C",
"severity": "High",
"suggestion": "Use static storage, allocated memory, or pass output buffer as parameter"
},
{
"column": 25,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 317,
"message": "Variable 'n1' is used uninitialized",
"rule_id": "EXP33-C",
"severity": "High",
"suggestion": "Initialize 'n1' before use, e.g., at its declaration"
},
{
"column": 32,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 317,
"message": "Variable 'n2' is used uninitialized",
"rule_id": "EXP33-C",
"severity": "High",
"suggestion": "Initialize 'n2' before use, e.g., at its declaration"
},
{
"column": 28,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 327,
"message": "Array declaration 'hooknames[]' has implicit bounds; specify explicit size",
"rule_id": "ARR02-C",
"severity": "Medium",
"suggestion": "Explicitly specify array bounds even when using an initializer"
},
{
"column": 7,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 360,
"message": "Bitwise operator '&' used on signed operand 'mask' of type 'int'. Use unsigned types for bitwise operations",
"rule_id": "INT13-C",
"severity": "Medium",
"suggestion": "Change 'mask' to an unsigned type (e.g., 'unsigned int' instead of 'int')"
},
{
"column": 7,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 361,
"message": "Bitwise operator '&' used on signed operand 'mask' of type 'int'. Use unsigned types for bitwise operations",
"rule_id": "INT13-C",
"severity": "Medium",
"suggestion": "Change 'mask' to an unsigned type (e.g., 'unsigned int' instead of 'int')"
},
{
"column": 7,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 362,
"message": "Bitwise operator '&' used on signed operand 'mask' of type 'int'. Use unsigned types for bitwise operations",
"rule_id": "INT13-C",
"severity": "Medium",
"suggestion": "Change 'mask' to an unsigned type (e.g., 'unsigned int' instead of 'int')"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 371,
"message": "Variable 'L1' is initialized but never modified, consider const-qualifying it",
"rule_id": "DCL00-C",
"severity": "Medium",
"suggestion": "Add 'const' qualifier: const L1 = ..."
},
{
"column": 26,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 372,
"message": "Variable 'arg' is used uninitialized",
"rule_id": "EXP33-C",
"severity": "High",
"suggestion": "Initialize 'arg' before use, e.g., at its declaration"
},
{
"column": 26,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 372,
"message": "Signed integer addition 'arg+1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 19,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 373,
"message": "Signed integer addition 'arg+1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 45,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 377,
"message": "Signed integer addition 'arg+2' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 23,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 378,
"message": "Signed integer addition 'arg+1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 37,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 379,
"message": "Signed integer addition 'arg + 3' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 385,
"message": "Passing string literal to function 'lua_setfield' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 20,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 391,
"message": "Signed integer addition 'arg + 1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 400,
"message": "Variable 'L1' is initialized but never modified, consider const-qualifying it",
"rule_id": "DCL00-C",
"severity": "Medium",
"suggestion": "Add 'const' qualifier: const L1 = ..."
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 423,
"message": "Non-void function may reach end without returning a value. Ensure all execution paths have explicit return statements.",
"rule_id": "MSC37-C",
"severity": "Medium",
"suggestion": "Add return statements to ensure all execution paths return a value"
},
{
"column": 9,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 427,
"message": "fgets() without truncation check. Input may be silently truncated.",
"rule_id": "FIO20-C",
"severity": "Medium",
"suggestion": "Check for newline character to detect truncation: if (strchr(buf, '\\n') == NULL) { /* handle truncation */ }"
},
{
"column": 16,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 428,
"message": "Variable 'buffer' is used uninitialized",
"rule_id": "EXP33-C",
"severity": "High",
"suggestion": "Initialize 'buffer' before use, e.g., at its declaration"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 440,
"message": "Variable 'L1' is initialized but never modified, consider const-qualifying it",
"rule_id": "DCL00-C",
"severity": "Medium",
"suggestion": "Add 'const' qualifier: const L1 = ..."
},
{
"column": 37,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 441,
"message": "Variable 'arg' is used uninitialized",
"rule_id": "EXP33-C",
"severity": "High",
"suggestion": "Initialize 'arg' before use, e.g., at its declaration"
},
{
"column": 37,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 441,
"message": "Signed integer addition 'arg + 1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 42,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 442,
"message": "Signed integer addition 'arg + 1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 22,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 443,
"message": "Signed integer addition 'arg + 1' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 41,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 445,
"message": "Signed integer addition 'arg + 2' may overflow without proper checking",
"rule_id": "INT32-C",
"severity": "High",
"suggestion": "Add overflow check: if ((b > 0 && a > INT_MAX - b) || (b < 0 && a < INT_MIN - b)) { /* handle error */ }"
},
{
"column": 23,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 452,
"message": "Array declaration 'dblib[]' has implicit bounds; specify explicit size",
"rule_id": "ARR02-C",
"severity": "Medium",
"suggestion": "Explicitly specify array bounds even when using an initializer"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 473,
"message": "Function 'luaopen_debug' does not validate pointer parameter 'L' before use",
"rule_id": "API00-C",
"severity": "Medium",
"suggestion": "Add validation check for 'L' at the start of the function, e.g., 'if (!L) { return error_code; }'"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/ldblib.c",
"line": 473,
"message": "Function 'luaopen_debug' should be declared static if it doesn't need external linkage",
"rule_id": "DCL15-C",
"severity": "Low",
"suggestion": "Add 'static' storage-class specifier: static LUAMOD_API luaopen_debug"
}
],
"lopcodes.h": [
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 128,
"message": "Function-like macro 'SET_OPCODE' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 128,
"message": "Macro evaluates parameter 'i' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 135,
"message": "Function-like macro 'setarg' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 135,
"message": "Macro evaluates parameter 'i' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 141,
"message": "Function-like macro 'GETARG_B' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 141,
"message": "Macro evaluates parameter 'i' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 143,
"message": "Function-like macro 'GETARG_vB' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 143,
"message": "Macro evaluates parameter 'i' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 149,
"message": "Function-like macro 'GETARG_C' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 149,
"message": "Macro evaluates parameter 'i' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 151,
"message": "Function-like macro 'GETARG_vC' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 151,
"message": "Macro evaluates parameter 'i' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 161,
"message": "Function-like macro 'GETARG_Bx' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 161,
"message": "Macro evaluates parameter 'i' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 164,
"message": "Function-like macro 'GETARG_Ax' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 164,
"message": "Macro evaluates parameter 'i' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 167,
"message": "Function-like macro 'GETARG_sBx' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 167,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp(checkopm(i, iAsBx), getarg(i, POS_Bx, SIZE_Bx) - OFFSET_sBx))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 167,
"message": "Macro evaluates parameter 'i' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 171,
"message": "Function-like macro 'GETARG_sJ' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 171,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp(checkopm(i, isJ), getarg(i, POS_sJ, SIZE_sJ) - OFFSET_sJ))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 171,
"message": "Macro evaluates parameter 'i' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 425,
"message": "Declaration is missing an explicit type specifier",
"rule_id": "DCL31-C",
"severity": "Low",
"suggestion": "Add an explicit type specifier to the declaration"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 427,
"message": "Macro parameter 'm' is not parenthesized in replacement text. This can cause operator precedence issues.",
"rule_id": "PRE01-C",
"severity": "Medium",
"suggestion": "Wrap parameter 'm' in parentheses: (m) instead of m"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 428,
"message": "Macro parameter 'm' is not parenthesized in replacement text. This can cause operator precedence issues.",
"rule_id": "PRE01-C",
"severity": "Medium",
"suggestion": "Wrap parameter 'm' in parentheses: (m) instead of m"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 429,
"message": "Macro parameter 'm' is not parenthesized in replacement text. This can cause operator precedence issues.",
"rule_id": "PRE01-C",
"severity": "Medium",
"suggestion": "Wrap parameter 'm' in parentheses: (m) instead of m"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 430,
"message": "Macro parameter 'm' is not parenthesized in replacement text. This can cause operator precedence issues.",
"rule_id": "PRE01-C",
"severity": "Medium",
"suggestion": "Wrap parameter 'm' in parentheses: (m) instead of m"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 436,
"message": "Function-like macro 'luaP_isOT' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lopcodes.h",
"line": 436,
"message": "Macro evaluates parameter 'i' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
}
],
"loslib.c": [
{
"column": 1,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 115,
"message": "Function-like macro 'lua_tmpnam' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 115,
"message": "Macro parameter 'e' is not parenthesized in replacement text. This can cause operator precedence issues.",
"rule_id": "PRE01-C",
"severity": "Medium",
"suggestion": "Wrap parameter 'e' in parentheses: (e) instead of e"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 115,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: ({ \\\n strcpy(b, LUA_TMPNAMTEMPLATE); \\\n e = mkstemp(b); \\\n if (e != -1) close(e); \\\n e = (e == -1); })"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 115,
"message": "Multistatement macro 'lua_tmpnam' is not wrapped in a do-while loop. This can cause issues when used in if statements without braces",
"rule_id": "PRE10-C",
"severity": "Medium",
"suggestion": "Wrap the macro body in: do { /* statements */ } while (0)"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 115,
"message": "Macro evaluates parameter 'b' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 125,
"message": "Macro parameter 'e' is not parenthesized in replacement text. This can cause operator precedence issues.",
"rule_id": "PRE01-C",
"severity": "Medium",
"suggestion": "Wrap parameter 'e' in parentheses: (e) instead of e"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 125,
"message": "Multistatement macro 'lua_tmpnam' is not wrapped in a do-while loop. This can cause issues when used in if statements without braces",
"rule_id": "PRE10-C",
"severity": "Medium",
"suggestion": "Wrap the macro body in: do { /* statements */ } while (0)"
},
{
"column": 29,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 168,
"message": "rename() called without handling destination file existence. Behavior is implementation-defined (POSIX removes dest, Windows fails).",
"rule_id": "FIO10-C",
"severity": "Medium",
"suggestion": "Either: (1) Call remove(dest) before rename(), OR (2) Check if dest exists with file_exists()/access()/stat() and handle accordingly"
},
{
"column": 21,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 184,
"message": "'getenv()' uses internal static storage that is shared between threads",
"rule_id": "CON34-C",
"severity": "Medium",
"suggestion": "Use 'secure_getenv or a cached copy' instead for thread safety"
},
{
"column": 51,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 233,
"message": "Pointer parameter 'stm' is not modified and should be declared const",
"rule_id": "DCL13-C",
"severity": "Low",
"suggestion": "Declare parameter as 'const <type> *stm'"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 234,
"message": "Passing string literal to function 'setfield' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 235,
"message": "Passing string literal to function 'setfield' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 236,
"message": "Passing string literal to function 'setfield' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 237,
"message": "Passing string literal to function 'setfield' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 238,
"message": "Passing string literal to function 'setfield' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 239,
"message": "Passing string literal to function 'setfield' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 240,
"message": "Passing string literal to function 'setfield' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 241,
"message": "Passing string literal to function 'setfield' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 242,
"message": "Passing string literal to function 'setboolfield' which may modify it",
"rule_id": "STR30-C",
"severity": "High",
"suggestion": "Use a modifiable array instead of a string literal"
},
{
"column": 31,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 256,
"message": "'key' (signed/plain char) converted to larger integer type without cast to 'unsigned char' - may cause sign extension",
"rule_id": "STR34-C",
"severity": "Medium",
"suggestion": "Cast to 'unsigned char' before conversion to larger type"
},
{
"column": 8,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 258,
"message": "Variable 'isnum' is used uninitialized",
"rule_id": "EXP33-C",
"severity": "High",
"suggestion": "Initialize 'isnum' before use, e.g., at its declaration"
},
{
"column": 58,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 275,
"message": "Pointer parameter should use conformant array syntax",
"rule_id": "API05-C",
"severity": "High",
"suggestion": "Use conformant array parameter syntax (e.g., 'char p[n]') with the size parameter declared before the array"
},
{
"column": 54,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 276,
"message": "Pointer parameter should use conformant array syntax",
"rule_id": "API05-C",
"severity": "High",
"suggestion": "Use conformant array parameter syntax (e.g., 'char p[n]') with the size parameter declared before the array"
},
{
"column": 7,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 283,
"message": "memcpy used for string copying may not include null terminator",
"rule_id": "STR31-C",
"severity": "Medium",
"suggestion": "Use strcpy/strncpy or memcpy with size+1 for null terminator"
},
{
"column": 24,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 309,
"message": "Variable 'slen' is used uninitialized",
"rule_id": "EXP33-C",
"severity": "High",
"suggestion": "Initialize 'slen' before use, e.g., at its declaration"
},
{
"column": 7,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 311,
"message": "Potential null pointer dereference of variable 's'",
"rule_id": "EXP34-C",
"severity": "High",
"suggestion": "Check if 's' is not NULL before dereferencing"
},
{
"column": 9,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 338,
"message": "Return value of 'strftime' assigned to 'reslen' but not checked for errors: 'strftime(buff, SIZETIMEFMT, cc, stm)' - Can return error indicator",
"rule_id": "ERR33-C",
"severity": "High",
"suggestion": "Check return value for errors"
},
{
"column": 5,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 363,
"message": "Return value of 'mktime' assigned to 't' but not checked for errors: 'mktime(&ts)' - Can return error indicator",
"rule_id": "ERR33-C",
"severity": "High",
"suggestion": "Check return value for errors"
},
{
"column": 20,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 385,
"message": "Array declaration 'cat[]' has implicit bounds; specify explicit size",
"rule_id": "ARR02-C",
"severity": "Medium",
"suggestion": "Explicitly specify array bounds even when using an initializer"
},
{
"column": 28,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 387,
"message": "Array declaration 'catnames[]' has implicit bounds; specify explicit size",
"rule_id": "ARR02-C",
"severity": "Medium",
"suggestion": "Explicitly specify array bounds even when using an initializer"
},
{
"column": 42,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 390,
"message": "'catnames' (signed/plain char) converted to larger integer type without cast to 'unsigned char' - may cause sign extension",
"rule_id": "STR34-C",
"severity": "Medium",
"suggestion": "Cast to 'unsigned char' before conversion to larger type"
},
{
"column": 21,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 391,
"message": "Call to non-thread-safe function 'setlocale'. Protect multithreaded access to locale-specific functions with a mutex",
"rule_id": "CON33-C",
"severity": "Medium",
"suggestion": "Protect multithreaded access to locale-specific functions with a mutex"
},
{
"column": 21,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 391,
"message": "'setlocale()' uses internal static storage that is shared between threads",
"rule_id": "CON34-C",
"severity": "Medium",
"suggestion": "Use 'uselocale' instead for thread safety"
},
{
"column": 10,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 404,
"message": "Function 'os_exit' calls 'exit', which dictates error handling. Application-independent code should report errors to the caller (via return values, error parameters, or error indicators) rather than terminating the program.",
"rule_id": "ERR05-C",
"severity": "Medium",
"suggestion": "Replace 'exit' with error reporting via return value (e.g., 'return ERROR_CODE;'), error parameter (e.g., '*err = ERROR_CODE;'), or global error indicator"
},
{
"column": 23,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 409,
"message": "Array declaration 'syslib[]' has implicit bounds; specify explicit size",
"rule_id": "ARR02-C",
"severity": "Medium",
"suggestion": "Explicitly specify array bounds even when using an initializer"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 428,
"message": "Function 'luaopen_os' does not validate pointer parameter 'L' before use",
"rule_id": "API00-C",
"severity": "Medium",
"suggestion": "Add validation check for 'L' at the start of the function, e.g., 'if (!L) { return error_code; }'"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/loslib.c",
"line": 428,
"message": "Function 'luaopen_os' should be declared static if it doesn't need external linkage",
"rule_id": "DCL15-C",
"severity": "Low",
"suggestion": "Add 'static' storage-class specifier: static LUAMOD_API luaopen_os"
}
],
"lstate.h": [
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 158,
"message": "Function-like macro 'stacksize' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 158,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (cast_int((th)->stack_last.p - (th)->stack.p))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 158,
"message": "Macro evaluates parameter 'th' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 263,
"message": "Function-like macro 'setcistrecst' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 263,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp(((st) & 7) == (st),)"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 263,
"message": "Macro evaluates parameter 'st' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 36,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 266,
"message": "Unsigned integer left shift 'cast(l_uint32, st) << CIST_RECST' may cause overflow without checking",
"rule_id": "INT30-C",
"severity": "High",
"suggestion": "Add shift overflow check before shifting"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 276,
"message": "Function-like macro 'setoah' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 276,
"message": "Macro evaluates parameter 'ci' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 375,
"message": "Macro parameter 'L' is not parenthesized in replacement text. This can cause operator precedence issues.",
"rule_id": "PRE01-C",
"severity": "Medium",
"suggestion": "Wrap parameter 'L' in parentheses: (L) instead of L"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 382,
"message": "Macro parameter 'g' is not parenthesized in replacement text. This can cause operator precedence issues.",
"rule_id": "PRE01-C",
"severity": "Medium",
"suggestion": "Wrap parameter 'g' in parentheses: (g) instead of g"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 414,
"message": "Function-like macro 'gco2ts' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 414,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts)))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 414,
"message": "Macro evaluates parameter 'o' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 416,
"message": "Function-like macro 'gco2u' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 416,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp((o)->tt == LUA_VUSERDATA, &((cast_u(o))->u)))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 416,
"message": "Macro evaluates parameter 'o' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 417,
"message": "Function-like macro 'gco2lcl' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 417,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp((o)->tt == LUA_VLCL, &((cast_u(o))->cl.l)))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 417,
"message": "Macro evaluates parameter 'o' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 418,
"message": "Function-like macro 'gco2ccl' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 418,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp((o)->tt == LUA_VCCL, &((cast_u(o))->cl.c)))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 418,
"message": "Macro evaluates parameter 'o' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 419,
"message": "Function-like macro 'gco2cl' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 419,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp(novariant((o)->tt) == LUA_TFUNCTION, &((cast_u(o))->cl)))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 419,
"message": "Macro evaluates parameter 'o' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 421,
"message": "Function-like macro 'gco2t' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 421,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp((o)->tt == LUA_VTABLE, &((cast_u(o))->h)))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 421,
"message": "Macro evaluates parameter 'o' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 422,
"message": "Function-like macro 'gco2p' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 422,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp((o)->tt == LUA_VPROTO, &((cast_u(o))->p)))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 422,
"message": "Macro evaluates parameter 'o' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 423,
"message": "Function-like macro 'gco2th' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 423,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp((o)->tt == LUA_VTHREAD, &((cast_u(o))->th)))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 423,
"message": "Macro evaluates parameter 'o' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 424,
"message": "Function-like macro 'gco2upv' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 424,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp((o)->tt == LUA_VUPVAL, &((cast_u(o))->upv)))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 424,
"message": "Macro evaluates parameter 'o' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 430,
"message": "Function-like macro 'obj2gco' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 430,
"message": "Macro replacement list should be parenthesized to prevent operator precedence issues.",
"rule_id": "PRE02-C",
"severity": "Medium",
"suggestion": "Wrap the entire replacement list in parentheses: (check_exp(novariant((v)->tt) >= LUA_TSTRING, &(cast_u(v)->gc)))"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 430,
"message": "Macro evaluates parameter 'v' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 435,
"message": "Function-like macro 'gettotalbytes' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lstate.h",
"line": 435,
"message": "Macro evaluates parameter 'g' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
}
],
"lua.h": [
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 177,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 178,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 179,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 180,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 181,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 182,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 183,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 185,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 192,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 193,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 194,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 195,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 196,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 197,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 200,
"message": "Function has pointer parameter without size argument: 'LUA_API lua_Number (lua_tonumberx) (lua_State *L, int idx, int *isnum);' - Add size_t parameter to specify array capacity",
"rule_id": "API02-C",
"severity": "High",
"suggestion": "Add a size_t parameter after 'int *isnum' to specify the maximum number of elements in the array"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 200,
"message": "Incompatible declarations of function 'lua_Number': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 201,
"message": "Function has pointer parameter without size argument: 'LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum);' - Add size_t parameter to specify array capacity",
"rule_id": "API02-C",
"severity": "High",
"suggestion": "Add a size_t parameter after 'int *isnum' to specify the maximum number of elements in the array"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 202,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 203,
"message": "Function has pointer parameter without size argument: 'LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len);' - Add size_t parameter to specify array capacity",
"rule_id": "API02-C",
"severity": "High",
"suggestion": "Add a size_t parameter after 'size_t *len' to specify the maximum number of elements in the array"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 205,
"message": "Incompatible declarations of function 'lua_CFunction': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 230,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 236,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 237,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 244,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 245,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 65,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 246,
"message": "Pointer parameter should use conformant array syntax",
"rule_id": "API05-C",
"severity": "High",
"suggestion": "Use conformant array parameter syntax (e.g., 'char p[n]') with the size parameter declared before the array"
},
{
"column": 14,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 248,
"message": "Pointer parameter should use conformant array syntax",
"rule_id": "API05-C",
"severity": "High",
"suggestion": "Use conformant array parameter syntax (e.g., 'char p[n]') with the size parameter declared before the array"
},
{
"column": 53,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 248,
"message": "Pointer parameter should use conformant array syntax",
"rule_id": "API05-C",
"severity": "High",
"suggestion": "Use conformant array parameter syntax (e.g., 'char p[n]') with the size parameter declared before the array"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 252,
"message": "Variadic function declaration should use proper header",
"rule_id": "EXP37-C",
"severity": "Medium",
"suggestion": "Include proper header instead of declaring variadic function"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 253,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 254,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 255,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 256,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 262,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 263,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 264,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 265,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 266,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 267,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 268,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 270,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 272,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 273,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 279,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 280,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 281,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 282,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 283,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 284,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 285,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 286,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 287,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 293,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 297,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 301,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 304,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 310,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 312,
"message": "Function has pointer parameter without size argument: 'LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg,' - Add size_t parameter to specify array capacity",
"rule_id": "API02-C",
"severity": "High",
"suggestion": "Add a size_t parameter after 'int *nres' to specify the maximum number of elements in the array"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 312,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 314,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 315,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 323,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 324,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 360,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 360,
"message": "Variadic function declaration should use proper header",
"rule_id": "EXP37-C",
"severity": "Medium",
"suggestion": "Include proper header instead of declaring variadic function"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 367,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 369,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 371,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 372,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 375,
"message": "Function has pointer parameter without size argument: 'LUA_API unsigned (lua_numbertocstring) (lua_State *L, int idx, char *buff);' - Add size_t parameter to specify array capacity",
"rule_id": "API02-C",
"severity": "High",
"suggestion": "Add a size_t parameter after 'char *buff' to specify the maximum number of elements in the array"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 379,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 381,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 382,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 394,
"message": "Macro 'lua_tointeger' reverses parameter order, creating inconsistent interface",
"rule_id": "API03-C",
"severity": "Medium",
"suggestion": "Avoid macros that reorder parameters. Maintain consistent parameter ordering across related functions"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 400,
"message": "Function-like macro 'lua_register' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 400,
"message": "Macro evaluates parameter 'L' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 423,
"message": "Function-like macro 'lua_remove' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 423,
"message": "Macro evaluates parameter 'L' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 425,
"message": "Function-like macro 'lua_replace' evaluates parameter(s) multiple times; prefer inline or static functions for type safety",
"rule_id": "PRE00-C",
"severity": "Low",
"suggestion": null
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 425,
"message": "Macro evaluates parameter 'L' multiple times; use inline function instead",
"rule_id": "PRE12-C",
"severity": "Medium",
"suggestion": "Replace macro with inline function to avoid multiple evaluation"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 436,
"message": "Macro 'lua_newuserdata' reverses parameter order, creating inconsistent interface",
"rule_id": "API03-C",
"severity": "Medium",
"suggestion": "Avoid macros that reorder parameters. Maintain consistent parameter ordering across related functions"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 470,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 471,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 478,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 481,
"message": "Incompatible declarations of function 'void': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 483,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 1,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 484,
"message": "Incompatible declarations of function 'int': parameter types differ",
"rule_id": "DCL40-C",
"severity": "High",
"suggestion": "Ensure all declarations of the same function have identical signatures"
},
{
"column": 3,
"file": "/home/brandon/toolchain/lua/lua.h",
"line": 504,
"message": "String buffer placed before pointer in struct 'lua_Debug': 'char short_src[LUA_IDSIZE];' before 'struct CallInfo *i_ci;' - Buffer overflow could corrupt pointer",
"rule_id": "API01-C",
"severity": "High",
"suggestion": "Move the string buffer 'char short_src' after the pointer field 'struct CallInfo *i_ci;', or use a char* pointer instead of a char array"
}
]
}