From: SourceForge.net <no...@so...> - 2008-12-26 23:09:17
|
Bugs item #2466950, was opened at 2008-12-25 20:04 Message generated for change (Comment added) made by borutr You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=2466950&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: librarian >Group: fixed >Status: Closed >Resolution: Fixed Priority: 7 Private: No Submitted By: Philipp Krause (spth) >Assigned to: Borut Ražem (borutr) Summary: sdcclib broken Initial Comment: For me sdcclib is completly broken, I can't even add an object file to a library - it will crash with an assertion failure: sdcclib: sdcclib.c:356: AddRel: Assertion `__s4567 == __res4567' failed. The bug has been introduced in revision #5293, which is the earliest version to break for me, #5292 work fine. Philipp ---------------------------------------------------------------------- >Comment By: Borut Ražem (borutr) Date: 2008-12-27 00:09 Message: fixed in svn revision #5302 by removing fgets return value check. Borut ---------------------------------------------------------------------- Comment By: Raphael Neider (tecodev) Date: 2008-12-26 23:30 Message: OK, my fault. The assertion introduced in l. 57 to quieten compiler warnings might be too restrictive: "fgets() return s on success, and NULL on error or when end of file occurs while no characters have been read." [manpage] The first one would have to be handled, second case should be prevented by the 'if (feof())' in l. 350. Philipp: If you find the time, could you investigate the cause for fgets failing? You might replace the macro in l. 54 by #define fgets(S, SIZE, STREAM) do { \ char *__s4567 = S; \ char *__res4567; \ errno = 0; \ __s4567[0] = 0; \ __res4567 = fgets(__s4567, SIZE, STREAM); \ if (errno) { \ perror("fgets failed, ignoring it"); \ } \ /*assert(__s4567 == __res4567);*/ \ } while (0) and report the error message (might require additional includes for errno/perror). As I am currently off my devel box: Could someone else please /*comment*/ the assert statement in sdcc/support/librarian/sdcclib.c, l. 57 (or replace it with '(void)__res4567;' or something like the untested code above)? The best solution would be -- of course -- to properly check the return value wherever fgets() is called and remove the fgets() wrapper macro completely ... Merry Christmas, Raphael ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=2466950&group_id=599 |