Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
muntoo
Posts: 834 Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:
Post
by muntoo » 27 May 2011, 06:33
Here's a program which produces a compiler error:
Code: Select all
# Error: Error parsing expression: __ArrHelper__MM_opMM_ID_219_0.id
File "C:\Users\Gateway\Documents\TheUser\Programming\BricxCC\NXC\Memory Manager\.\MM_op.nxc" ; line 128
#
#----------------------------------------------------------
# Error: Error parsing expression: __ArrHelper__MM_opMM_ID_219_1.id
File "C:\Users\Gateway\Documents\TheUser\Programming\BricxCC\NXC\Memory Manager\.\MM_op.nxc" ; line 129
#
#----------------------------------------------------------
2 errors during compilation
On the following line:
Code: Select all
if(opands[0].id != tmp_opands[0].id)
Last edited by
muntoo on 28 May 2011, 04:07, edited 1 time in total.
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange:
bit.ly/Area51LEGOcommit
afanofosc
Site Admin
Posts: 1256 Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:
Post
by afanofosc » 27 May 2011, 19:02
This defect seems to have been fixed since the following program compiles fine on my developer box.
Code: Select all
struct Foo {
int id;
};
task main()
{
Foo opands[1];
Foo tmp_opands[1];
if(opands[0].id != tmp_opands[0].id)
Wait(SEC_1);
}
I dug around in SVN but I can't pinpoint when/where a change was made to fix this. Does the above code not compile for you?
John Hansen
muntoo
Posts: 834 Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:
Post
by muntoo » 27 May 2011, 21:28
That code sample you posted does...
This is my current version:
Code: Select all
Next Byte Codes Compiler version 1.2 (1.2.1.r4, built Tue Mar 15 15:38:58 CDT 2011)
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange:
bit.ly/Area51LEGOcommit
afanofosc
Site Admin
Posts: 1256 Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:
Post
by afanofosc » 28 May 2011, 02:21
I can't work with your full memory manager code to try and track down this bug. You'll have to give me something simple like what I posted that demonstrates the problem. Maybe it has something to do with inline functions?
John Hansen
muntoo
Posts: 834 Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:
Post
by muntoo » 28 May 2011, 03:51
Here's a narrowed down version:
Code: Select all
struct MM_ID {
unsigned int type;
unsigned int len;
unsigned long idx;
};
MM_ID MM_op(unsigned long op, MM_ID opands[], MM_ID out = MM_ID_NULL) {
MM_ID tmp_opands[];
if(opands[0].id != tmp_opands[0].id) {
MM_ID tmp = tmp_opands[0];
}
return(out);
}
task main() {
TextOut(0, 0, "Hello, world!", 0);
}
And here's the error:
Code: Select all
# Error: Error parsing expression: __ArrHelper__MM_opMM_ID_219_0.id
File "C:\Users\Gateway\Desktop\test.nxc" ; line 10
#
#----------------------------------------------------------
# Error: Error parsing expression: __ArrHelper__MM_opMM_ID_219_1.id
File "C:\Users\Gateway\Desktop\test.nxc" ; line 10
#
#----------------------------------------------------------
2 errors during compilation
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange:
bit.ly/Area51LEGOcommit
afanofosc
Site Admin
Posts: 1256 Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:
Post
by afanofosc » 28 May 2011, 22:59
Dude. Your struct does not have a member called "id". It has one called "idx". If I rename the member in MM_ID to "id" rather than "idx" the code compiles fine.
John Hansen
muntoo
Posts: 834 Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:
Post
by muntoo » 28 May 2011, 23:04
afanofosc wrote: Dude. Your struct does not have a member called "id". It has one called "idx". If I rename the member in MM_ID to "id" rather than "idx" the code compiles fine.
ARRGH!
Thanks.
My excuse: The compiler errors are hard to decipher, though. Something like "
# Error: Error parsing expression: .id member not found
", maybe?
Maybe I should rename them all to
.id
because I find myself making this mistake constantly...
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange:
bit.ly/Area51LEGOcommit
Users browsing this forum: Semrush [Bot] and 12 guests