The Monkey C compiler doesn't complain about invalid device id (argument to "-d") in compiler options, because the VS Code Monkey C extension build system already specifies a valid device id earlier in the command line.
This is a problem because someone could accidentally add the option "-disable-api-has-check-removal" (for example), with one leading hyphen instead of two. They might think that "--disable-api-has-check-removal" was specified, even though it wasn't, especially since the compiler would not emit a warning or error.
I know this is a plausible scenario because that advice was just given in the CIQ forums:
Observed behavior:
- I specify "-disable-api-has-check-removal" as a compiler command line option in the monkey c vs code settings
- I expect the compiler to emit the following error (or something similar): "Invalid device id: isable-api-has-check-removal". (Because a single hyphen specifies a short option, and any characters beyond the first letter of a short option are treated as the argument to that option. This can be verified by manually running the compiler with a command line such as "-dfr965" (no space between "-" and "fr965") and observing that it still works properly
Actual behavior:
- I specify "-disable-api-has-check-removal" as a compiler command line option in the monkey c vs code settings
- The compiler emits no warning or error
Example command line:
java -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar %APPDATA%\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-7.4.3-2024-12-11-90ec25e45\bin\monkeybrains.jar -o bin\makeImageRequestTEST.prg -f project_path\monkey.jungle -y "key_path\developer_key" -d fr965_sim -w -O 3 -disable-api-has-check-removal