Changes maximum stacktrace string values to better allow for inclusion of values up to PATH_MAX. I don't like it. The values are huge. Need a better more sensible way.

This commit is contained in:
2026-05-24 09:50:21 -04:00
parent be2dba8416
commit 7700af06a1

View File

@@ -6,13 +6,19 @@
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <limits.h>
#endif #endif
#define AKERR_MAX_ERROR_CONTEXT_STRING_LENGTH 1024 // FIXME: This is huge now. It used to be 1000 bytes, then I wanted to report errors
// related to filesystem paths, which made it grow beyond PATH_MAX, then I started
// reporting messages including 2 file paths (PATH_MAX * 2), so now to make the compiler warnings
// shut up, it's enormous (PATH_MAX*3).
#define AKERR_MAX_ERROR_CONTEXT_STRING_LENGTH 12384
#define AKERR_MAX_ERROR_NAME_LENGTH 64 #define AKERR_MAX_ERROR_NAME_LENGTH 64
#define AKERR_MAX_ERROR_FNAME_LENGTH 256 #define AKERR_MAX_ERROR_FNAME_LENGTH PATH_MAX
#define AKERR_MAX_ERROR_FUNCTION_LENGTH 128 #define AKERR_MAX_ERROR_FUNCTION_LENGTH 128
#define AKERR_MAX_ERROR_STACKTRACE_BUF_LENGTH 2048 #define AKERR_MAX_ERROR_STACKTRACE_BUF_LENGTH (AKERR_MAX_ERROR_CONTEXT_STRING_LENGTH + AKERR_MAX_ERROR_NAME_LENGTH + AKERR_MAX_ERROR_FNAME_LENGTH + AKERR_MAX_ERROR_FUNCTION_LENGTH + 16)
#define AKERR_LAST_ERRNO_VALUE AKERR_LAST_ERRNO_VALUE_SED #define AKERR_LAST_ERRNO_VALUE AKERR_LAST_ERRNO_VALUE_SED