This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Strange Definition

Moving a project from IAR EW8051 to Keil PK51 because I have a restricted set of IAR tools and I have full set of Keil tools.

In many places in the code there is a construct such as for(uint8 i=0; i < 50; i++), etc.

Keil PK51 will say "undefined var i, etc". So I define i as uint8 i; and then PK51 will say datatype not allowed which is what I would expect. Remove the uint8 in the 'for' statement and Keil is happy.

For gents that have used both packages(I know Erik has), can you tell me if IAR has such a language extension or is there some type of macro that I been unable to find that would allow such a var definition within the 'for' statement. It is also used in 'if' statements and 'while' loops, etc.

Is this something I missed in C 101 or has shades of BASIC sneaked into IAR?

Oh yes, the project does build in IAR but not in Keil and not in TI Code Composer. I know Code Composer does not support the 8051 but I was just compiling short C files without device definitions. Have not tried Visual Studio.

Just looked again and saw IAR uses other datatypes such as char and uint16 datatype within 'for and 'if' statements.

Thanks,

Bradford