Close

It works, except the comments are broken...

A project log for install-avr-tools

Given Windows with some version of Arduino installed, set the paths to allow using avr-gcc/etc from the command line.

westfwWestfW 02/24/2017 at 08:190 Comments

I guess this is a known windows batch problem, but it took me WAY too long to figure out...

It turns out that windows batch has a comment command "REM" that is ugly, and a commonly used and documented convention where you precede comments with a double colon "::", which is a little bit prettier.

But double-colon comment have a bug. The following batch file will cause a "cannot find the drive" error!

if "%1"=="" (
  :: comment1
  ::  comment2
  echo foo
)
This is apparently because "::" isn't REALLY a comment command of any kind; it's actually a label. An empty label, which therefore can't be used as a target of GOTO or CALL or anything, and therefore isn't "executed." But cmd.exe doesn't like having two empty labels inside the same () block. Or something. Grrrr...

Discussions