Skip to content

Build fails on macOS/clang: MAX_LINES treated as VLA triggers -Wgnu-folding-constant #191

@dbarabashh

Description

@dbarabashh

Env: macOS (clang via Xcode CLT), current master, make with repo defaults.

clang errors in src/runna.c:
src/runna.c:41:12: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant]
char path[MAX_LINES];
This happens because MAX_LINES is a const int, which is not a compile-time constant for array bounds in C under clang, so it’s treated as a

VLA and the GNU extension is an error under -Werror.
Fix: make MAX_LINES a real compile-time constant, e.g. #define MAX_LINES 500 (or enum { MAX_LINES = 500 };). This resolves the clang warning/error and make succeeds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions