LOG_ERROR
- Macro
- August 22, 2025
Table of Contents
LOG_ERROR
LOG_ERROR
Description
Writes an error-level log message. …[in] : Format string and arguments following printf-style syntax.
Success
Error message written to log output
Failure
Logging fails silently (output not guaranteed)
Usage example (Cross-references)
- In
JSON.h:417
:
/* starting of an object */ \
if (StrIterPeek(&si) != '[') { \
LOG_ERROR("Invalid array start. Expected '['."); \
si = saved_si; \
break; \
- In
JSON.h:431
:
if (expect_comma) { \
if (StrIterPeek(&si) != ',') { \
LOG_ERROR("Expected ',' between values in array. Invalid JSON array."); \
failed = true; \
si = saved_si; \
- In
JSON.h:451
:
/* if still no advancement in read position */ \
if (read_si.pos == si.pos) { \
LOG_ERROR("Failed to parse value. Invalid JSON."); \
StrDeinit(&key); \
failed = true; \
- In
JSON.h:468
:
if (!failed) { \
if (StrIterPeek(&si) != ']') { \
LOG_ERROR("Invalid end of array. Expected ']'."); \
failed = true; \
si = saved_si; \
- In
JSON.h:509
:
/* starting of an object */ \
if (StrIterPeek(&si) != '{') { \
LOG_ERROR("Invalid object start. Expected '{'."); \
si = saved_si; \
break; \
- In
JSON.h:524
:
if (expect_comma) { \
if (StrIterPeek(&si) != ',') { \
LOG_ERROR("Expected ',' after key/value pairs in object. Invalid JSON object."); \
failed = true; \
si = saved_si; \
- In
JSON.h:539
:
read_si = JReadString(si, &key); \
if (read_si.pos == si.pos) { \
LOG_ERROR("Failed to read string key in object. Invalid JSON"); \
StrDeinit(&key); \
failed = true; \
- In
JSON.h:551
:
\
if (StrIterPeek(&si) != ':') { \
LOG_ERROR("Expected ':' after key string. Failed to read JSON"); \
StrDeinit(&key); \
failed = true; \
- In
JSON.h:573
:
/* if still no advancement in read position */ \
if (read_si.pos == si.pos) { \
LOG_ERROR("Failed to parse value. Invalid JSON."); \
StrDeinit(&key); \
failed = true; \
- In
JSON.h:594
:
char c = StrIterPeek(&si); \
if (c != '}') { \
LOG_ERROR("Expected end of object '}' but found '{c}'", c); \
failed = true; \
si = saved_si; \
- In
Sys.c:80
:
SysDirEntry* SysDirEntryInitCopy(SysDirEntry* dst, SysDirEntry* src) {
if (!dst || !src) {
LOG_ERROR("invalid arguments.");
return NULL;
}
- In
Sys.c:93
:
SysDirEntry* SysDirEntryDeinitCopy(SysDirEntry* copy) {
if (!copy) {
LOG_ERROR("invalid arguments.");
return NULL;
}
- In
Sys.c:153
:
SysDirContents SysGetDirContents(const char* path) {
if (!path) {
LOG_ERROR("invalid arguments.");
return (SysDirContents) {0};
}
- In
Sys.c:164
:
StrInitStack(err, SYS_ERROR_STR_MAX_LENGTH, {
SysStrError(errno, &err);
LOG_ERROR("opendir(\"{}\") failed : {}", path, err);
});
return (SysDirContents) {0};
- In
Sys.c:235
:
StrInitStack(err, SYS_ERROR_STR_MAX_LENGTH, {
SysStrError(errno, &err);
LOG_ERROR("failed to open file: {}\n", err);
});
return -1;
- In
Sys.c:245
:
StrInitStack(err, SYS_ERROR_STR_MAX_LENGTH, {
SysStrError(errno, &err);
LOG_ERROR("failed to get file size: {}\n", err);
});
CloseHandle(file);
- In
Sys.c:262
:
StrInitStack(err, SYS_ERROR_STR_MAX_LENGTH, {
SysStrError(errno, &err);
LOG_ERROR("failed to get file size: {}\n", err);
});
return -1;
- In
Sys.c:312
:
Str* SysGetCurrentExecutablePath(Str* exe_path) {
if (!exe_path) {
LOG_ERROR("Invalid arguments: exe_path is NULL");
return NULL;
}
- In
Sys.c:320
:
DWORD len = GetModuleFileNameA(NULL, buffer, MAX_PATH);
if (len == 0 || len >= MAX_PATH) {
LOG_ERROR("Failed to get executable path or buffer too small");
return NULL;
}
- In
Sys.c:347
:
// Last resort fallback
LOG_ERROR("Could not determine executable path, using fallback");
*exe_path = StrInitFromZstr("unknown_executable");
return exe_path;
- In
Sys.c:559
:
SysProcInfo* SysCreateProcess(const char* executable, Strs* argv, Strs* env) {
if (!executable) {
LOG_ERROR("Invalid executable path");
return NULL;
}
- In
Sys.c:565
:
SysProcInfo* proc_info = NEW(SysProcInfo);
if (!proc_info) {
LOG_ERROR("Failed to allocate process info");
return NULL;
}
- In
Sys.c:601
:
if (!success) {
DWORD error = GetLastError();
LOG_ERROR("CreateProcess failed with error {}", error);
FREE(proc_info);
return NULL;
- In
JSON.c:16
:
// starting of an object
if (StrIterPeek(&si) != '{') {
LOG_ERROR("Invalid object start. Expected '{'.");
return saved_si;
}
- In
JSON.c:29
:
if (expect_comma) {
if (StrIterPeek(&si) != ',') {
LOG_ERROR(
"Expected ',' between key/value pairs in object. Invalid "
"JSON object."
- In
JSON.c:44
:
read_si = JReadString(si, &key);
if (read_si.pos == si.pos) {
LOG_ERROR("Failed to read string key in object. Invalid JSON");
StrDeinit(&key);
return saved_si;
- In
JSON.c:52
:
if (StrIterPeek(&si) != ':') {
LOG_ERROR("Expected ':' after key string. Failed to read JSON");
StrDeinit(&key);
return saved_si;
- In
JSON.c:64
:
// if still no advancement in read position
if (read_si.pos == si.pos) {
LOG_ERROR("Failed to parse value. Invalid JSON.");
StrDeinit(&key);
return saved_si;
- In
JSON.c:81
:
char c = StrIterPeek(&si);
if (c != '}') {
LOG_ERROR("Expected end of object '}' but found '{c}'", c);
return saved_si;
}
- In
JSON.c:99
:
// starting of an object
if (StrIterPeek(&si) != '[') {
LOG_ERROR("Invalid array start. Expected '['.");
return saved_si;
}
- In
JSON.c:112
:
if (expect_comma) {
if (StrIterPeek(&si) != ',') {
LOG_ERROR("Expected ',' between values in array. Invalid JSON array.");
return saved_si;
}
- In
JSON.c:124
:
// if no advancement in read position
if (read_si.pos == si.pos) {
LOG_ERROR("Failed to parse value. Invalid JSON.");
return saved_si;
}
- In
JSON.c:137
:
// end of array
if (StrIterPeek(&si) != ']') {
LOG_ERROR("Invalid end of array. Expected ']'.");
return saved_si;
}
- In
JSON.c:172
:
if (!str) {
LOG_ERROR("Invalid str object to read into.");
return si;
}
- In
JSON.c:199
:
StrIterNext(&si);
if (!StrIterRemainingLength(&si)) {
LOG_ERROR("Unexpected end of string.");
StrClear(str);
return saved_si;
- In
JSON.c:248
:
// espaced unicode sequence
case 'u' :
LOG_ERROR(
"No unicode support '{.6}'. Unicode sequence will be skipped.",
LVAL(si.data + si.pos - 1)
- In
JSON.c:256
:
default :
LOG_ERROR("Invalid JSON object key string.");
StrClear(str);
return saved_si;
- In
JSON.c:280
:
if (!num) {
LOG_ERROR("Invalid number object.");
return si;
}
- In
JSON.c:304
:
case 'e' :
if (has_exp) {
LOG_ERROR("Invalid number. Multiple exponent indicators.");
StrDeinit(&ns);
return saved_si;
- In
JSON.c:316
:
case '.' :
if (is_flt) {
LOG_ERROR("Invalid number. Multiple decimal indicators.");
StrDeinit(&ns);
return saved_si;
- In
JSON.c:343
:
// +/- can only appear after an exponent
if (!has_exp) {
LOG_ERROR(
"Invalid number. Exponent sign indicators '+' or '-' "
"must appear after exponent 'E' or 'e' indicator."
- In
JSON.c:351
:
}
if (has_exp_plus_minus) {
LOG_ERROR(
"Invalid number. Multiple '+' or '-' in Number. "
"Expected only once after 'e' or 'E'."
- In
JSON.c:370
:
if (!ns.length) {
LOG_ERROR("Failed to parse number. '{.8}'", LVAL(saved_si.data + saved_si.pos));
StrDeinit(&ns);
return saved_si;
- In
JSON.c:383
:
}
if (end == ns.data) {
LOG_ERROR("Failed to convert string to number.");
StrDeinit(&ns);
return saved_si;
- In
JSON.c:408
:
if (!val) {
LOG_ERROR("Invalid pointer to integer. Don't know where to store.");
return si;
}
- In
JSON.c:417
:
if (si.pos == saved_si.pos) {
LOG_ERROR("Failed to parse integer number.");
return saved_si;
}
- In
JSON.c:422
:
if (num.is_float) {
LOG_ERROR("Failed to parse integer. Got floating point value.");
return saved_si;
}
- In
JSON.c:437
:
if (!val) {
LOG_ERROR("Invalid pointer to float. Don't know where to store.");
return si;
}
- In
JSON.c:446
:
if (si.pos == saved_si.pos) {
LOG_ERROR("Failed to parse floating point number");
return saved_si;
}
- In
JSON.c:465
:
if (!b) {
LOG_ERROR("Invalid boolean pointer. Don't know where to store.");
return si;
}
- In
JSON.c:480
:
return si;
}
LOG_ERROR("Failed to read boolean value. Expected true. Invalid JSON");
return saved_si;
}
- In
JSON.c:492
:
return si;
}
LOG_ERROR("Failed to read boolean value. Expected false. Invalid JSON");
return saved_si;
}
- In
JSON.c:497
:
}
LOG_ERROR("Failed to parse boolean value. Expected true/false. Invalid JSON");
return saved_si;
} else {
- In
JSON.c:500
:
return saved_si;
} else {
LOG_ERROR(
"Insufficient string length to parse a boolean value. Unexpected "
"end of input."
- In
JSON.c:514
:
if (!is_null) {
LOG_ERROR("Invalid boolean pointer. Don't know where to store.");
return si;
}
- In
JSON.c:530
:
return si;
}
LOG_ERROR("Failed to read boolean value. Expected null. Invalid JSON");
return saved_si;
}
- In
JSON.c:536
:
return saved_si;
} else {
LOG_ERROR(
"Insufficient string length to parse a boolean value. Unexpected "
"end of input."
- In
JSON.c:559
:
if (si.pos == before_si.pos) {
LOG_ERROR(
"Failed to read boolean value. Expected true/false. Invalid "
"JSON."
- In
JSON.c:576
:
if (si.pos == before_si.pos) {
LOG_ERROR(
"Failed to read boolean value. Expected true/false. Invalid "
"JSON."
- In
JSON.c:595
:
if (si.pos == before_si.pos) {
LOG_ERROR("Failed to read string value. Expected string. Invalid JSON.");
return saved_si;
}
- In
JSON.c:609
:
if (si.pos == before_si.pos) {
LOG_ERROR("Failed to read number value. Expected a number. Invalid JSON.");
return saved_si;
}
- In
JSON.c:622
:
if (si.pos == before_si.pos) {
LOG_ERROR("Failed to read object. Expected an object. Invalid JSON.");
return saved_si;
}
- In
JSON.c:635
:
if (si.pos == before_si.pos) {
LOG_ERROR("Failed to read array. Expected an array. Invalid JSON.");
return saved_si;
}
- In
JSON.c:642
:
}
LOG_ERROR("Failed to read value. Invalid JSON");
return si;
}
- In
Log.c:35
:
StrInitStack(syserr, SYS_ERROR_STR_MAX_LENGTH, {
SysStrError(errno, &syserr);
LOG_ERROR("Failed to get localtime : {}", syserr);
});
goto LOG_STREAM_FALLBACK;
- In
Log.c:82
:
StrInitStack(syserr, SYS_ERROR_STR_MAX_LENGTH, {
SysStrError(e, &syserr);
LOG_ERROR("Failed to open log file : {}", syserr);
});
goto LOG_STREAM_FALLBACK;
- In
File.c:17
:
bool ReadCompleteFile(const char *filename, char **data, size *file_size, size *capacity) {
if (!filename || !data || !file_size || !capacity) {
LOG_ERROR("invalid arguments.");
return false;
}
- In
File.c:24
:
i64 fsize = SysGetFileSize(filename);
if (-1 == fsize) {
LOG_ERROR("failed to get file size");
return false;
}
- In
File.c:61
:
StrInitStack(syserr, SYS_ERROR_STR_MAX_LENGTH, {
SysStrError(e, &syserr);
LOG_ERROR("fopen() failed : {}", syserr);
});
- In
File.c:73
:
StrInitStack(syserr, SYS_ERROR_STR_MAX_LENGTH, {
SysStrError(errno, &syserr);
LOG_ERROR("failed to read complete file. : {}", syserr);
});
- In
Io.c:167
:
default :
LOG_ERROR("Invalid format specifier");
return false;
}
- In
Io.c:174
:
if (pos < len) {
LOG_ERROR(
"Parsing format specifier ended, but more characters are left for parsing. Indicates invalid format "
"specifier."
- In
Io.c:246
:
// Error if no closing brace found
if (brace_end >= fmt_len) {
LOG_ERROR("Unclosed format specifier");
return false;
}
- In
Io.c:264
:
// Check if we have enough arguments
if (arg_idx >= argc) {
LOG_ERROR("Not enough arguments for format string");
return false;
}
- In
Io.c:300
:
var_width = 8;
} else {
LOG_ERROR(
"Raw data writing can only be used for u8-64, i8-64, f32, f64. Either unsupported format or "
"attempt to write a complex type."
- In
Io.c:308
:
if (fmt_info.width > var_width) {
LOG_ERROR(
"Number of raw bytes to be written exceeds variable width. Excess data filled with zeroes."
);
- In
Io.c:333
:
}
default : {
LOG_ERROR("Unreachable code reached");
return false;
}
- In
Io.c:360
:
}
default : {
LOG_ERROR("Unreachable code reached");
return false;
}
- In
Io.c:379
:
continue;
}
LOG_ERROR("Unmatched closing brace");
return false;
} else {
- In
Io.c:388
:
// Check if we used all arguments
if (arg_idx < argc) {
LOG_ERROR("Too many arguments for format string");
return false;
}
- In
Io.c:408
:
if (remaining >= 2 && p[0] == '{' && p[1] == '{') {
if (!in || *in != '{') {
LOG_ERROR("Expected '{' in input");
return NULL;
}
- In
Io.c:416
:
} else if (remaining >= 2 && p[0] == '}' && p[1] == '}') {
if (!in || *in != '}') {
LOG_ERROR("Expected '}' in input");
return NULL;
}
- In
Io.c:436
:
if (remaining == 0 || *p != '}') {
LOG_ERROR("Unmatched '{' in format string");
return NULL;
}
- In
Io.c:443
:
char spec_buf[32] = {0};
if (spec_len >= sizeof(spec_buf)) {
LOG_ERROR("Format specifier too long");
return NULL;
}
- In
Io.c:448
:
if (arg_index >= argc) {
LOG_ERROR("More placeholders than arguments");
return NULL;
}
- In
Io.c:458
:
FmtInfo fmt_info;
if (!ParseFormatSpec(spec_buf, spec_len, &fmt_info)) {
LOG_ERROR("Failed to parse format specifier");
return NULL; // Error already logged by ParseFormatSpec
}
- In
Io.c:465
:
TypeSpecificIO* io = &argv[arg_index++];
if (!io->reader) {
LOG_ERROR("Missing reader function");
return NULL;
}
- In
Io.c:491
:
}
default : {
LOG_ERROR("Invalid raw data read width specified. Must be one of 1, 2, 4 or 8.");
return NULL;
}
- In
Io.c:512
:
var_width = 8;
} else {
LOG_ERROR(
"Raw data reading can only be used for u8-64, i8-64, f32, f64. Either unsupported format or "
"attempt to read a complex type."
- In
Io.c:542
:
}
default : {
LOG_ERROR("Invalid raw data read width specified. Must be one of 1, 2, 4 or 8.");
return NULL;
}
- In
Io.c:553
:
// Check if reading failed
if (!next || next == in) {
LOG_ERROR("Failed to read value for placeholder {}", LVAL(arg_index - 1));
return NULL;
}
- In
Io.c:566
:
// Match exact character from format string
if (!in || *in != *p) {
LOG_ERROR(
"Input '{.8}' does not match format string '{.8}'",
LVAL(in ? in : "(null)"),
- In
Io.c:620
:
Str err = StrInit();
SysStrError(errno, &err);
LOG_ERROR("Could not save file position for rollback: {}", err);
StrDeinit(&err);
}
- In
Io.c:630
:
if (!(new_pos = StrReadFmtInternal(buffer.data, fmtstr, argv, argc))) {
if (can_rollback) {
LOG_ERROR("Parse failed, rolling back...");
fsetpos(file, &start_pos);
} else {
- In
Io.c:633
:
fsetpos(file, &start_pos);
} else {
LOG_ERROR("Parse failed, and rollback not possible on non-seekable input");
}
}
- In
Io.c:1190
:
const char* s = *str;
if (*s != '\\') {
LOG_ERROR("ProcessEscape called on non-escape sequence");
return 0;
}
- In
Io.c:1234
:
s++;
if (!isxdigit(s[0]) || !isxdigit(s[1])) {
LOG_ERROR("Invalid hex escape sequence");
return 0;
}
- In
Io.c:1243
:
}
default :
LOG_ERROR("Invalid escape sequence '\\{c}'", s[0]);
return 0;
}
- In
Io.c:1267
:
// Check for empty input
if (!*i) {
LOG_ERROR("Empty input string");
return i;
}
- In
Io.c:1344
:
// If we get here with a quote, the string was unterminated
if (quote) {
LOG_ERROR("Unterminated quoted string");
StrDeinit(s);
return NULL;
- In
Io.c:1531
:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse f64: empty input");
return i;
}
- In
Io.c:1605
:
// Validate the string is a proper floating point number
if (!IsValidNumericString(&temp, true)) {
LOG_ERROR("Invalid floating point format");
StrDeinit(&temp);
return start;
- In
Io.c:1612
:
// Use StrToF64 directly
if (!StrToF64(&temp, v, NULL)) {
LOG_ERROR("Failed to parse f64");
StrDeinit(&temp);
return start;
- In
Io.c:1631
:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse u8: empty input");
return i;
}
- In
Io.c:1662
:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:1669
:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:1677
:
u64 val;
if (!StrToU64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse u8");
StrDeinit(&temp);
return start;
- In
Io.c:1684
:
// Check for overflow
if (val > UINT8_MAX) {
LOG_ERROR("Value {} exceeds u8 maximum ({})", val, UINT8_MAX);
StrDeinit(&temp);
return start;
- In
Io.c:1712
:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse u16: empty input");
return i;
}
- In
Io.c:1737
:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:1744
:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:1752
:
u64 val;
if (!StrToU64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse u16");
StrDeinit(&temp);
return start;
- In
Io.c:1759
:
// Check for overflow
if (val > UINT16_MAX) {
LOG_ERROR("Value {} exceeds u16 maximum ({})", val, UINT16_MAX);
StrDeinit(&temp);
return start;
- In
Io.c:1787
:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse u32: empty input");
return i;
}
- In
Io.c:1811
:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:1818
:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:1826
:
u64 val;
if (!StrToU64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse u32");
StrDeinit(&temp);
return start;
- In
Io.c:1833
:
// Check for overflow
if (val > UINT32_MAX) {
LOG_ERROR("Value {} exceeds u32 maximum ({})", val, UINT32_MAX);
StrDeinit(&temp);
return start;
- In
Io.c:1861
:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse u64: empty input");
return i;
}
- In
Io.c:1886
:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:1893
:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:1900
:
// Use base 0 to let strtoul detect the base from prefix
if (!StrToU64(&temp, v, NULL)) {
LOG_ERROR("Failed to parse u64");
StrDeinit(&temp);
return start;
- In
Io.c:1926
:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse i8: empty input");
return i;
}
- In
Io.c:1951
:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:1958
:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:1966
:
i64 val;
if (!StrToI64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse i8");
StrDeinit(&temp);
return start;
- In
Io.c:1973
:
// Check for overflow/underflow
if (val > INT8_MAX || val < INT8_MIN) {
LOG_ERROR("Value {} outside i8 range ({} to {})", val, INT8_MIN, INT8_MAX);
StrDeinit(&temp);
return start;
- In
Io.c:2001
:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse i16: empty input");
return i;
}
- In
Io.c:2026
:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:2033
:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:2041
:
i64 val;
if (!StrToI64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse i16");
StrDeinit(&temp);
return start;
- In
Io.c:2048
:
// Check for overflow/underflow
if (val > INT16_MAX || val < INT16_MIN) {
LOG_ERROR("Value {} outside i16 range ({} to {})", val, INT16_MIN, INT16_MAX);
StrDeinit(&temp);
return start;
- In
Io.c:2076
:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse i32: empty input");
return i;
}
- In
Io.c:2101
:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:2108
:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:2116
:
i64 val;
if (!StrToI64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse i32");
StrDeinit(&temp);
return start;
- In
Io.c:2123
:
// Check for overflow/underflow
if (val > INT32_MAX || val < INT32_MIN) {
LOG_ERROR("Value {} outside i32 range ({} to {})", val, INT32_MIN, INT32_MAX);
StrDeinit(&temp);
return start;
- In
Io.c:2151
:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse i64: empty input");
return i;
}
- In
Io.c:2176
:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:2183
:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:2190
:
// Use base 0 to let strtoul detect the base from prefix
if (!StrToI64(&temp, v, NULL)) {
LOG_ERROR("Failed to parse i64");
StrDeinit(&temp);
return start;
- In
Io.c:2218
:
char* result = malloc(temp.length + 1);
if (!result) {
LOG_ERROR("Failed to allocate memory for string");
StrDeinit(&temp);
return i;
- In
Io.c:2302
:
// Check for empty input
if (!*i) {
LOG_ERROR("Empty input string");
return i;
}
- In
Io.c:2320
:
if (i == hex_start) {
LOG_ERROR("Invalid hex format - no digits after 0x");
return start;
}
- In
Io.c:2329
:
StrParseConfig config = {.base = 16};
if (!StrToU64(&hex_str, &value, &config)) {
LOG_ERROR("Failed to parse hex value");
StrDeinit(&hex_str);
return start;
- In
Io.c:2356
:
if (i == oct_start) {
LOG_ERROR("Invalid octal format - no digits after 0o");
return start;
}
- In
Io.c:2365
:
StrParseConfig config = {.base = 8};
if (!StrToU64(&oct_str, &value, &config)) {
LOG_ERROR("Failed to parse octal value");
StrDeinit(&oct_str);
return start;
- In
Io.c:2389
:
if (i == bin_start) {
LOG_ERROR("Invalid binary format - expected 0s and 1s");
return start;
}
- In
Io.c:2428
:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse f32: empty input");
return i;
}
- In
Io.c:2504
:
// Validate the string is a proper floating point number
if (!IsValidNumericString(&temp, true)) {
LOG_ERROR("Invalid floating point format");
StrDeinit(&temp);
return start;
- In
Io.c:2512
:
f64 val;
if (!StrToF64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse f32");
StrDeinit(&temp);
return start;
- In
Str.c:52
:
size n = vsnprintf(NULL, 0, fmt, args);
if (!n) {
LOG_ERROR("invalid size of final string.");
return NULL;
}
- In
Str.c:336
:
if (!is_valid_base(config->base)) {
LOG_ERROR("Invalid base: {}", config->base);
return NULL;
}
- In
Str.c:383
:
if (!is_valid_base(config->base)) {
LOG_ERROR("Invalid base: {}", config->base);
return NULL;
}
- In
Str.c:417
:
if (config->precision > 17) {
LOG_ERROR("Precision {} exceeds maximum (17)", config->precision);
return NULL;
}
- In
Str.c:571
:
if (!value) {
LOG_ERROR("NULL output pointer");
return false;
}
- In
Str.c:581
:
u8 base = config->base;
if (base != 0 && !is_valid_base(base)) {
LOG_ERROR("Invalid base: {}", base);
return false;
}
- In
Str.c:591
:
if (pos >= str->length) {
LOG_ERROR("Empty string");
return false;
}
- In
Str.c:624
:
if (IS_SPACE(str->data[pos]))
break;
LOG_ERROR("Invalid digit for base {}: {c}", base, str->data[pos]);
return false;
}
- In
Str.c:630
:
// Check overflow
if (result > (UINT64_MAX - digit) / base) {
LOG_ERROR("Overflow");
return false;
}
- In
Str.c:644
:
if (config->strict && pos < str->length) {
LOG_ERROR("Extra characters after number");
return false;
}
- In
Str.c:649
:
if (!have_digits) {
LOG_ERROR("No valid digits found");
return false;
}
- In
Str.c:661
:
if (!value) {
LOG_ERROR("NULL output pointer");
return false;
}
- In
Str.c:675
:
if (pos >= str->length) {
LOG_ERROR("Empty string");
return false;
}
- In
Str.c:706
:
if (negative) {
if (unsigned_value > 9223372036854775808ULL) {
LOG_ERROR("Overflow");
return false;
}
- In
Str.c:712
:
} else {
if (unsigned_value > 9223372036854775807ULL) {
LOG_ERROR("Overflow");
return false;
}
- In
Str.c:725
:
if (!value) {
LOG_ERROR("NULL output pointer");
return false;
}
- In
Str.c:739
:
if (pos >= str->length) {
LOG_ERROR("Empty string");
return false;
}
- In
Str.c:834
:
if (!have_exp_digits) {
LOG_ERROR("Missing exponent digits");
return false;
}
- In
Str.c:848
:
if (config->strict && pos < str->length) {
LOG_ERROR("Extra characters after number");
return false;
}
- In
Str.c:853
:
if (!have_digits) {
LOG_ERROR("No valid digits found");
return false;
}
- In
MisraEnum.c:85
:
if (!e.name.length) {
LOG_ERROR("Invalid enum entry in 'entries' array. Entry without name.");
abort();
}
- In
MisraEnum.c:96
:
if (to_from_str && !e.str.length) {
LOG_ERROR("to_from_str is set to true but str value not provided for enum {}", e.name);
abort();
}
- In
MisraEnum.c:140
:
"{} {}FromZstr(const char* zstr) {{\n"
" if(!zstr) {{\n"
" LOG_ERROR(\"Invalid string provided. Cannot convert to enum.\");\n"
" return {};\n"
" }}\n";
- In
ElfInfo.c:341
:
FILE* elf = fopen(argv[1], "rb");
if (!elf) {
LOG_ERROR("Failed to open file for reading.");
return 1;
}
- In
MisraDoc.c:29
:
void ProjectDeinit(Project* p) {
if (!p) {
LOG_ERROR("Invalid project object. Invalid arguments");
abort();
}
- In
MisraDoc.c:173
:
&file_contents.capacity
)) {
LOG_ERROR("Failed to read \"{}\" source file.", file_path.data);
continue;
}
- In
Main.c:24
:
VecDeinit(&file);
} else {
LOG_ERROR("Failed to read file");
}
return 0;