Bug: semicolon after DEFINE constant

If you define constant like:

#define D1 10;

it will cause strange error on a row that uses the constant saying

"error: expected ')' before ';' token"

Bug environment: Snow Leopard, Arduino 0017

Oddly enough, that's not a compiler bug, so you don't have to report it.

Imagine you've written:

if (myPin == D1)

the preprocessor would have substituted

if (myPin == 10;)

which is not syntactically correct.

Don't put semicolons on the end of preprocessor macros, unless you really know what you're doing.

Like your other "bug" post, it shouldn't be here.

I admit, both "Bugs" I submitted are not bugs. I've been programming 20 years and haven't bumbed into these issues before. Seriously.

However both are problems. It's quite easy to say "please don't put.." to me than to a newbie who is struggling hours because the method call doesn't get there because some missing ()-marks.

I think both issues should be here, where then? They are as far as I concern issues that should be handled somehow. How about compiler warnings? Or "dummy" mode where you're not allowed to enter ; after #define?

They are as far as I concern issues that should be handled somehow

No, there's little or nothing that can be done; both postings concern perfectly valid C that has been used in the wrong context.*

Your standalone function pointer evaluation "bug" will probably produce compiler warnings, but so then will many things that people write; the Arduino walks a fine line between usabilty and swamping people with error messages they won't understand.

If you have a problem with something you've written, put it in the "Syntax and Programs" section.

This "Bugs and suggestions" section is for problems that are caused by deficiencies or errors in system software or hardware.

*Someone wrote here recently "Most computer languages will let you shoot yourself in the foot; C hands you the gun"