e9patch icon indicating copy to clipboard operation
e9patch copied to clipboard

e9compile fixes

Open milahu opened this issue 1 year ago • 2 comments

fix #75 etc

remove the include path examples/ users should set their own include paths

e9compile foo.c -I bar/

milahu avatar Feb 06 '24 12:02 milahu

Thanks for interest in cleaning this up. But I think some of the changes are not compatible with older versions of bash, e.g.:

    $ ./e9compile.sh print.c
    ./e9compile.sh: 65: ./e9compile.sh: Syntax error: "(" unexpected

It works fine in newer versions. Generally I'd prefer it works on even very old versions, if there is no pressing reason to use newer features.

GJDuck avatar Feb 07 '24 01:02 GJDuck

true, this breaks in posix shells

$ ash e9compile.sh asdf.c
e9compile.sh: line 65: syntax error: unexpected "("
CFLAGS=(

$ mrsh e9compile.sh asdf.c
e9compile.sh:20:10: syntax error: invalid parameter name
    RED=$'\033[31m'

$ yash e9compile.sh asdf.c
e9compile.sh:54: syntax error: invalid character `@' in parameter expansion
e9compile.sh:54: syntax error: `esac' is missing
        echo "${RED}error${OFF}: file ${1@Q} must have a .c/.cpp/.s extension" >&2

the only thing that would work is removing the -I examples/ arguments

milahu avatar Feb 07 '24 07:02 milahu