View unanswered posts | View active topics It is currently Sun Dec 21, 2014 7:33 pm






Reply to topic  [ 2 posts ] 
RobotC 3.50 bug 6 
Author Message
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1372
Post RobotC 3.50 bug 6
The following code gave the compiler error:
**Error**:Calling procedure 'ObjInit'. Expression does not fit parameter. Parameter: 'unsigned short * pi'. Expression: '((void *) 0))'. Type: 'void *'
Code:
typedef struct
{
    int *pi;
} OBJ;

OBJ g_obj;

void ObjInit(OBJ *obj, int *pi)
{
    obj->pi = pi;
}

task main()
{
    ObjInit(&g_obj, NULL);
}

It looks like it doesn't like me passing NULL as a parameter to type int *.
I also tried to type cast it to:
Code:
    ObjInit(&g_obj, (int *)NULL);

But it gave me a different compiler error:
**Error**:'const' expression '(long *) ((void *) 0)))' cannot be used for non 'const' procedure parameter 'pi'


Wed Sep 19, 2012 7:51 am
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 616
Post Re: RobotC 3.50 bug 6
This is definitely an issue that we will be resolving in the next build of ROBOTC.

One additional thing to note is that since ROBOTC is a "case-insensitive" language, that variable PI is a known language constant so that may cause issues in the future once the root caused is fixed.

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Sat Sep 22, 2012 8:06 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 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.