sasagawa888 / eisl

ISLisp interpreter/compiler
Other
272 stars 22 forks source link

Fix trivial errors and warnings #244

Closed lassik closed 1 year ago

lassik commented 1 year ago

This fixes v2.72 build on MacOS. Also fixes some compiler warnings emitted by LLVM clang.

sasagawa888 commented 1 year ago

Thank you.

sasagawa888 commented 1 year ago

On Linux Mint occurs error.

e.g. cii/src/fmt.c:101:28: error: expected ‘;’, ‘,’ or ‘)’ before ‘__unused’ 101 | static void cvt_c(int code __unused, va_list_box box, | ^~~~ cii/src/fmt.c:149:29: error: ‘cvt_c’ undeclared here (not in a function); did you mean ‘cvt_f’? 149 | / 96-103 */ 0, 0, 0, cvt_c, cvt_d, cvt_f, cvt_f, cvt_f, | ^~~~~

sasagawa888 commented 1 year ago

I deleted __unused in cii/mem.c fmt.c text.c str.c. On Linux MInt it is OK.

lassik commented 1 year ago

You're welcome.

The statement (void)foo; is a portable way to say that variable foo is unused.

lassik commented 1 year ago

For example:

int test(int x, int y, int z) {
    (void)x;
    return y * z;
}
sasagawa888 commented 1 year ago

Thanks for fixing bugs I was unaware of.