View unanswered posts | View active topics It is currently Wed Dec 17, 2014 8:52 pm






Reply to topic  [ 6 posts ] 
Compiler crash involving undefined procedures in functions 
Author Message
Rookie

Joined: Wed Jan 16, 2013 4:23 pm
Posts: 3
Post Compiler crash involving undefined procedures in functions
I'm getting an error that causes robotC to crash on compile with a generic "ROBOTC Integrated Development Environment has stopped working" message. (On older operating systems it simply closes with no message.) This is on RobotC 3.08, compiling for NXT. (Yes, I know it's old, but I just want to make sure it gets fixed if it hasn't been yet. If it's fixed on newer versions I figure my work here is done.)

The crash appears to occur whenever the following conditions are all met:
- A function has an undefined procedure in it. (like if you have a typo in a function name)
- The function takes at least one input.
- The function is correctly called, and its output is assigned to a variable.

The crash DOESN'T occur if the output is used, but not assigned to a variable. For example, if a function named testFunc has the error in it, the line

x = testFunc(100);

would cause the crash, but the line

if(testFunc(100)>50)

would not cause the crash.

My testing was done on Windows 7.

Like I said, this isn't stopping me from doing anything, since it only occurs when you'd have a compiler error anyway, but I really want to know how on earth there's a crash this specific, and I want to bring it to your attention if it's not already fixed.


Wed Jan 16, 2013 4:41 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post Re: Compiler crash involving undefined procedures in functio
I am using 3.55 B 2 and this piece of code does not crash the IDE:

Code:
task main()
{
  int x;
  x = testFunc(100);
 
 
  if(testFunc(100)>50)
  {
    // do nothing
  }

}

I just get an error:
Code:
File "unknownfunctest.c" compiled on Jan 17 2013 07:17:25
**Error**:Undefined procedure 'testFunc'.
**Error**:Too many parameters specified. Call to 'testFunc'. Parameter: 'N/A' is '100' of type 'char'.
**Error**:Too many parameters specified. Call to 'testFunc'. Parameter: 'N/A' is '100' of type 'char'.


= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Jan 17, 2013 2:18 am
Profile WWW
Rookie

Joined: Wed Jan 16, 2013 4:23 pm
Posts: 3
Post Re: Compiler crash involving undefined procedures in functio
Sorry, I wasn't clear enough. testFunc would need to be a real function, it's inside testFunc that needs to have an undefined procedure.

For example

Code:
int testFunc(int x)
{
  ait1Msec(1000);
  return x;
}

task main()
{
  int x = testFunc(100);
}


crashes my compiler.


Thu Jan 17, 2013 2:25 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post Re: Compiler crash involving undefined procedures in functio
I am running 3.55 B2 and I see this:
Code:
File "unknownfunccrash.c" compiled on Jan 17 2013 20:29:21
**Error**:Undefined procedure 'ait1Msec'.
**Error**:Too many parameters specified. Call to 'ait1Msec'. Parameter: 'N/A' is '1000' of type 'short'.
**Info***:'x' is written but has no read references


No crash.
Solution: update your ROBOTC. You can get 3.55 B2 from here: viewtopic.php?f=52&t=5122

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Jan 17, 2013 3:30 pm
Profile WWW
Rookie

Joined: Wed Jan 16, 2013 4:23 pm
Posts: 3
Post Re: Compiler crash involving undefined procedures in functio
Ok, glad it got fixed since the release I'm running.

(Although I admit I'm slightly sad I'll probably never know what caused it.)


Thu Jan 17, 2013 5:25 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post Re: Compiler crash involving undefined procedures in functio
akraut wrote:
(Although I admit I'm slightly sad I'll probably never know what caused it.)

A bug in the compiler or IDE, most likely :)

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Jan 18, 2013 12:30 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.