Interesting Syntax glitch

I ran across an interesting observation... this WILL compile:

class Object
{
  public:

  private:

};

void evaluateScores(Object* a, Object* b);

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

void evaluateScores(Object* a, Object* b)
{
  
}

but this won't:

class Object
{
  public:

  private:

};

void evaluateScores(Object* a, Object* b);

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

void evaluateScores( Object* a, Object* b)
{
  
}

*notice the whitespace in the function before Object a in the 2nd example

can anyone tell me why that matters? Is the compiler particularly fussy when it comes to function prototypes matching and whitespace? I never noticed before, because this compiles:

class Object
{
  public:

  private:

};

void evaluateScores(int a, int b);

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

void evaluateScores( int a, int b)
{
  
}

Weird...to my knowledge, any C based language doesn't have a problem with whitespace...

What error is produced?

sketch_feb25b.ino:4:22: error: variable or field 'evaluateScores' declared void
sketch_feb25b.ino:4:22: error: 'Object' was not declared in this scope
sketch_feb25b.ino:4:30: error: 'a' was not declared in this scope
sketch_feb25b.ino:4:33: error: 'Object' was not declared in this scope
sketch_feb25b.ino:4:41: error: 'b' was not declared in this scope
Error compiling.

version 1.6.3

Why is it seeing line 41? I don't see that many.

The failed example compiles for me, with IDE 1.6.6

aarg: Why is it seeing line 41? I don't see that many.

The failed example compiles for me, with IDE 1.6.6

I guess the 'bug' was dealt with!

BulldogLowell: I guess the 'bug' was dealt with!

While at the same time making it impossible to program a Pro Micro. :(

Fails in 1.6.5 too.
Preprocessed version:

#line 1 "sketch_feb26a.ino"
#include "Arduino.h"
void setup();
void loop();
void evaluateScores( Object* a, Object* b);  // <<< Generated (unnecessary) prototype placed too early 
#line 1
class Object
{
  public:

  private:

};

void evaluateScores(Object* a, Object* b);

void setup() {


}

void loop() {


}

void evaluateScores( Object* a, Object* b)
{

}

oqibidipo: Fails in 1.6.5 too.

thanks. it actually took me a while to figure out why i was getting compiler error.

BulldogLowell: I ran across an interesting observation... this WILL compile:

That's VERY strange. I also have the problem you described.

Now, here's something interesting: If I put the whitespace in the FIRST occurrence of "evaluateScores", then it compiles.

If I put a whitespace between the function name and the opening parentheses, it fails! If I match both lines (that is, the SAME whitespaces), it compiles.

Then I tried it with a Makefile and AVR-GCC v4.9.3 (i.e. not using the IDE at all) and STILL have the problem, so it's a GCC bug, not an IDE bug.

For what it's worth.......

Smells of a regular expression problem.

For what it's worth.......

Ditto.