#1
|
|||
|
|||
C error
../userprog/exception.cc: In function `char* UserToSystem(int, int, int)':
../userprog/exception.cc:107: parse error before `)' token ../userprog/exception.cc:107: parse error before `)' token ../userprog/exception.cc:129: parse error before `)' token ../userprog/exception.cc: In function `int SystemToUser(int, int, int, char*)': ../userprog/exception.cc:145: parse error before `)' token ../userprog/exception.cc:145: parse error before `)' token ../userprog/exception.cc:165: parse error before `)' token ../userprog/exception.cc:170: parse error before `)' token oddly enough the line of code is: if((numbytes<0) && ((charmode!=M_ASCII) || (charmode!=M_BINARY))) i doubt i'll get any useful replies but my TA is taking forever so i thought hell i'll give this a whirl. numbytes, charmode is defined in the function declaration and M_ASCII/M_BINARY are #define b4 class starts. |
#2
|
|||
|
|||
Re: C error
it looks like the error comes before this line.
|
#3
|
|||
|
|||
Re: C error
Yeah, I'm thinking C error, but not in the same way as you, I reckon.
|
#4
|
|||
|
|||
Re: C error
[ QUOTE ]
it looks like the error comes before this line. [/ QUOTE ] i thought so too, as is usual with these compilers, but everything before it (4 lines) is just declarations of variables...no ( ) whatsoever. and then the function header...this project is due in 5 days. i'm toast. |
#5
|
|||
|
|||
Re: C error
where are these functions (e.g. UserToSystem) actually being called? look at those lines.
|
#6
|
|||
|
|||
Re: C error
the error isn't where you think it is. you'd have to post a whole lot more than this for us to tell you. it's probably something that seems totally unrelated to the error messages. like a missing semi-colon at the end of a line. or something.
|
#7
|
|||
|
|||
Re: C error
[ QUOTE ]
the error isn't where you think it is. you'd have to post a whole lot more than this for us to tell you. it's probably something that seems totally unrelated to the error messages. like a missing semi-colon at the end of a line. or something. [/ QUOTE ] i'm thinking "or something". i don't think a missing semi colon will be missed by the compiler |
#8
|
|||
|
|||
Re: C error
[ QUOTE ]
where are these functions (e.g. UserToSystem) actually being called? look at those lines. [/ QUOTE ] it isn't exactly being called yet. i'm using gcc's gmake command...so i'm just linking right now... |
#9
|
|||
|
|||
Re: C error
[ QUOTE ]
i'm thinking "or something". i don't think a missing semi colon will be missed by the compiler [/ QUOTE ] you are mistaken. [img]/images/graemlins/smile.gif[/img] i've definitely seen it before |
#10
|
|||
|
|||
Re: C error
cut back on the function until its a small amount of text that compiles. add in lines progressively and try to narrow down where the error is...think do this is a binary search type manner and it shouldn't take too long...
|
|
|