Shlomi Fish avatar Shlomi Fish committed 1b5621b

More declarations after statements.

https://rt.cpan.org/Ticket/Display.html?id=69622 .

Comments (0)

Files changed (3)

 Revision history for Perl extension XML::LibXML
 
+    - Fixed missing declarations after statements:
+        - resolves https://rt.cpan.org/Ticket/Display.html?id=69622 again.
+        - thanks to Vadim / VKON.
+
 1.82            Wed Jul 20 23:43:53 IDT 2011
     - Moved some if blocks after the dSP; (which contains declarations) to be
     compliant with C89/C90, which don't allow declarations in the middle of
 =cut
 ----------------
 
-Perl
+No declarations after statements
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+One should make sure there are no declarations after statements in the ANSI
+C code. If you're using gcc, you can make sure this is the case by adding
+the flags "-Wdeclaration-after-statement -Werror" to "CCFLAGS" in the makefile.

perl-libxml-sax.c

     SV * rv = NULL;
 
     if ( ch != NULL && handler != NULL ) {
+        dSP;
+
         int len = xmlStrlen( ch );
 
         if (sax->joinchars)
             PSaxCharactersFlush(ctxt, sax->charbuf);
         }
 
-        dSP;
-
         ENTER;
         SAVETMPS;
 
     SV * rv = NULL;
 
     if ( ch != NULL && handler != NULL ) {
+        dSP;
 
         if (sax->joinchars)
         {
             PSaxCharactersFlush(ctxt, sax->charbuf);
         }
 
-        dSP;
 
         ENTER;
         SAVETMPS;
     SV * rv = NULL;
 
     if ( handler != NULL ) {
+        dSP;
+
         if (sax->joinchars)
         {
             PSaxCharactersFlush(ctxt, sax->charbuf);
         }
-
-        dSP;
     
         ENTER;
         SAVETMPS;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.