Jump to content
Sign in to follow this  
TimC

C2c++ Internal Error

Recommended Posts

When not implementing a Declared member function the compiler produces an internal error:

----------------------------------------------

C2C++ 6.1.1e C/C++ compiler ....

(Extended version)

...

Tim1.cpp

C:\PROGRA~1\PIC\SOURCE~1\Lib\cppPIC2.lib

Message: Built-in variables are obsolete and mapped to PIC16F84 address space. Use variables defined inside the system header file

Internal error in ..\..\comp\gencsect.cpp line 3765 (6.1.1e)

...

-------------------------------------------- CODE

class Tim1 {

public:

char style;

int mpg();

};

 

// Tim1::mpg() {

// return 2; // If I uncomment these 3 lines.. no problem.

// }

 

-------------------------------------------- CODE END

This issue makes it very hard to compile little by little. The classes need to be completely defined beforehand.

 

 

Thanks

Tim

Share this post


Link to post
Share on other sites

I can't reproduce the problem. Similar code compiler fine:

 

#include <system.h>

class Tim1
{
public:
char style;
int mpg(); 
};

int Tim1::mpg()
{
return 2; 
}

main()
{
Tim1 t;
t.mpg();
}

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

The problem happends when one or more of the functions have not been implemented yet.

So stating "int mpg();" means you have to have "int Tim1::mpg()"

 

The following produces the internal error.

 

/////////////////////////////////////////////////
// Basic classes 
/////////////////////////////////////////////////
#include <system.h>

class Tim1
{
public:
   char style;
   int mpg();
};

//int Tim1::mpg()
//{
//    return 2;
//}

main()
{
   Tim1 t;
//    t.mpg();
}

 

 

With a simple example like this it is easy to find but when classes are large you are forced to track functions to make sure each one is implemented.

 

Regards

TimC

Share this post


Link to post
Share on other sites

Got it. Yes this is a compiler bug. Now fixed. We will release a patch in couple of days. This patch will include the updated C2C++ compiler as well. Thanks for reporting.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...