Re: [Parser-devel] [token.c] realloc() producing warning while compilation
Status: Beta
Brought to you by:
jineshkj
From: Noam P. <npo...@uw...> - 2006-09-27 23:19:55
|
Jinesh K J wrote: >> I think the next thing to do is handle invalid input: eg unclosed >> quotes, right now that causes a segfault. I'm not sure what the >> appropriate way of signalling an error would be. > Ohh! That's a very serious issue. Good that you reminded me. Don't worry. > If the quote doesn't close, let the '\0' at the end of string be taken for granted. Done > >> >> Noam > > BTW, I've added -Wall to cc and some warnings have been removed. One is still left, > which is in token.c. See below: > > [jinesh@jinesh np]$ make > cc -Wall -g -D DETAILED=0 token.c > > main.c > token.c: In function 'gettoken': > token.c:78: warning: ignoring return value of 'realloc', declared with attribute warn_unused_result > > I hope that the realloc return value could be used. What so you say? > > > > Jinesh. > I say: oops, I should read the docs on realloc more carefully :P I fixed all the test cases except one I think is wrong: [Hello ' World ] -> ["Hello ' World " ] The extra space at the end is just a typo, right? Noam. |