i'll just leave these here in case you're interested in patching them:
regexp.c:82:9: error: comma at end of enumerator list [-Werror=pedantic]
L_COUNT, /* {M,N} */
^
regexp.c:395:7: error: comma at end of enumerator list [-Werror=pedantic]
P_REF,
^
regexp.c: In function ‘default_alloc’:
regexp.c:906:34: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
static void *default_alloc(void *ctx, void *p, int n)
^~~
The fixes for the first two are simply to remove the trailing commas. Stupidly enough, fixing the unused function parameter by removing its name will, in that same build mode, then fail with "parameter name omitted". The portable workaround is ugly but works:
There are very many other things in MuJS that do not work in strict C89 (use of NAN, INFINITY, snprintf, signbit, etc) that I don't feel this is worth fixing for one file.
i'll just leave these here in case you're interested in patching them:
The fixes for the first two are simply to remove the trailing commas. Stupidly enough, fixing the unused function parameter by removing its name will, in that same build mode, then fail with "parameter name omitted". The portable workaround is ugly but works:
With those 3 tweaks, regex.c compiles in strict/pedantic C89 mode. (FWIW, i use your regexp code as a loadable module for my own scripting language.)