Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] What does this error mean?

2005-02-22 by Mike Murphree

Leon Heller said:
>
> ----- Original Message -----
> From: kc9dag
> To: AVR-Chat@yahoogroups.com
> Sent: Tuesday, February 22, 2005 5:45 PM
> Subject: [AVR-Chat] What does this error mean?
>
>
>
> I've done all my previous AVR programing in ASM and I program in C# on a
> daily basis so I figured I should finally learn C for the
> AVR...  Things have been going fine and now I am getting the
> following error:
>
> Datalogger.c: In function `main':
> Datalogger.c:48: error: redeclaration of 'inty' with no linkage
> Datalogger.c:48: error: previous definition of 'inty' was here
> Datalogger.c:48: error: parse error before '<' token
> Datalogger.c:48: error: parse error before ')' token
> Datalogger.c:48: warning: unused variable `inty'
>
> for this chunk of code:
>
> 45  for(unsigned int x = 0; x <= pagecount; x++)
> 46  {
> 47        Page_To_Buffer(x, 1);
> 48        for(unsigned int inty = 0, inty < 0xFF; inty++)
> 49        {
> 50              sendChar(Buffer_Read_Byte(1, inty));
> 51        }
> 52  }
>
> I don't understand the "redeclaration of 'inty' with no linkage" when
> inty only exist in this piece of code;
> I'm guessing the my C# is messing me up and I am declaing this wrong,
> but then I'm not sure why the for x chunk is not erroring out.

What evilness allows you define variables inside a for loop structure
like that?

Take them out, and precede this code with:

unsigned int x, inty;

Mike

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.