Last modified: 2007-01-07 19:13:51 UTC
the following patches adresses two problems of flexbisonparse (current svn version): 1- supression of warning during compilation by inclusion of stdlib.h in parsetree.c and of string.h in wikiparse.y (kind of warning suppressed: " warning: incompatible implicit declaration of built-in function ‘printf’") 2- I got a sementation fault when processing big (17kB) files with the following command : "./wikiparse < ../../bigfile.wiki ". It turned out that this is due to the printf in main(), and that the problem disapeared with "printf ("%s", outputXML (articlenode, 1024));" instead of "printf ( outputXML (articlenode, 1024) ) ;" (I don't really know why, I'm not a C expert...) the patch is as follow: Index: wikiparse.y =================================================================== --- wikiparse.y (revision 16034) +++ wikiparse.y (working copy) @@ -11,6 +11,7 @@ ** Originally written 2004 by Timwi **/ +#include <string.h> #include <stdio.h> #include "parsetree.h" #include "fb_defines.h" @@ -633,7 +634,7 @@ // printf ("Parsing... "); result = yyparse(); - if (!result) printf ( outputXML (articlenode, 1024) ) ; + if (!result) printf ("%s", outputXML (articlenode, 1024)); // printf ("\n\nXML output:\n\n%s\n\n", outputXML (articlenode, 1024)); freeRecursively (articlenode); return result; Index: parsetree.c =================================================================== --- parsetree.c (revision 16034) +++ parsetree.c (working copy) @@ -11,6 +11,7 @@ #include "parsetree.h" #include "fb_defines.h" +#include <stdlib.h> #include <string.h> #include <stdio.h>
I applied your patches even though flexbisonparse is nore maintained.