View unanswered posts | View active topics It is currently Tue Aug 04, 2020 8:06 am

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

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
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 *'
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:
    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
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 620
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

Sat Sep 22, 2012 8:06 pm
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest

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.