redeclared as different kind of symbol only on Teensy 3.

Status
Not open for further replies.

2n3055

Well-known member
Hi,


This code compile without error on Teensy2 but not with Teensy3 ?

What is wrong ?

Code:
byte index = 0;
char message[10];


void setup() 
{
strcpy(message,"123456");

}

void loop() 
{
  Serial.print("\r\nmessage ");
  while (message[index] != '\0')
  {
    Serial.print(message[index]);
    index++;
  }
}

Thanks
 
index() is defined as a function in string.h. This function seems to be deprecated but it looks like the ARM compiler used for Teensy 3 still implements it. I assume that the AVR compiler for Teensy2 does not implement it, so that your example compiles for a Teensy2.

Just rename your variable to something else and it will compile.
 
Status
Not open for further replies.
Back
Top