Re: Complie Error



On Wed, 31 Jul 2002, Arun-Kumar Krishnan wrote:
Dear Sir,

thanking you for showing me the way as my code is like this

elem_init(8,8);
static portrait_get_state(Portrait *port)
int I,
PortraitEnd *end;
PortaritState *state=g_new0(PortaritState,1);
state->obj_state.free=portrait_state_free;
state->global=g_strdup(port->global);

for (i=0;i<8;i++)
{
end=&port->end[i]
state->end[i].IN= g_strdup(end->IN);
state->end[i].OUT= g_strdup(end->OUT);
}
return state;

That is not even close to being real C.  I count 8 errors that a compiler
would catch, only one of which matches the error you asked about.  If this
is the actual code you've been trying to compile and not just a copy by
hand, you need to go back and relearn some C basics.  If this is a copy by
hand, please show use the actual code.

and error is 'end' might be used uninitialized in this function

That's not the same error you were asking about.

-Lars

-- 
Lars Clausen (http://shasta.cs.uiuc.edu/~lrclause)| Hårdgrim of Numenor
"I do not agree with a word that you say, but I   |----------------------------
will defend to the death your right to say it."   | Where are we going, and
    --Evelyn Beatrice Hall paraphrasing Voltaire  | what's with the handbasket?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]