Last modified: 2007-01-07 19:13:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T9001, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7001 - patches for flexbisonparse
patches for flexbisonparse
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
PC Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-13 17:27 UTC by CyrilB
Modified: 2007-01-07 19:13 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description CyrilB 2006-08-13 17:27:41 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>
Comment 1 Antoine "hashar" Musso (WMF) 2007-01-07 19:13:51 UTC
I applied your patches even though flexbisonparse is nore maintained.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links