bsuh / node_xslt

a simple XSLT addon for node
zlib License
71 stars 17 forks source link

Lot of warnings and notes at install #19

Closed lexblagus closed 9 years ago

lexblagus commented 11 years ago

It works fine, but I got a lot of messagens on installing:

blagus@quirks:~$ npm install node_xslt
npm http GET https://registry.npmjs.org/node_xslt
npm http 304 https://registry.npmjs.org/node_xslt

> node_xslt@0.1.8 preinstall /Users/blagus/node_modules/node_xslt
> node-gyp rebuild

  CXX(target) Release/obj.target/node_xslt/node_xslt.o
../node_xslt.cc:45:1: warning: unused variable '_argn' [-Wunused-variable]
FUNCTION(readXmlFile)
^
../macros.h:103:41: note: expanded from macro 'FUNCTION'
                                    int _argn=0;    \
                                        ^
../node_xslt.cc:56:1: warning: unused variable '_argn' [-Wunused-variable]
FUNCTION(readXmlString)
^
../macros.h:103:41: note: expanded from macro 'FUNCTION'
                                    int _argn=0;    \
                                        ^
../node_xslt.cc:67:1: warning: unused variable '_argn' [-Wunused-variable]
FUNCTION(readHtmlFile)
^
../macros.h:103:41: note: expanded from macro 'FUNCTION'
                                    int _argn=0;    \
                                        ^
../node_xslt.cc:78:1: warning: unused variable '_argn' [-Wunused-variable]
FUNCTION(readHtmlString)
^
../macros.h:103:41: note: expanded from macro 'FUNCTION'
                                    int _argn=0;    \
                                        ^
../node_xslt.cc:89:1: warning: unused variable '_argn' [-Wunused-variable]
FUNCTION(readXsltFile)
^
../macros.h:103:41: note: expanded from macro 'FUNCTION'
                                    int _argn=0;    \
                                        ^
../node_xslt.cc:107:1: warning: unused variable '_argn' [-Wunused-variable]
FUNCTION(readXsltString)
^
../macros.h:103:41: note: expanded from macro 'FUNCTION'
                                    int _argn=0;    \
                                        ^
../node_xslt.cc:175:13: warning: unused variable 'scopeGuard175' [-Wunused-variable]
            ON_BLOCK_EXIT(xmlFree, doc_ptr);
            ^
../scopeguard.h:317:53: note: expanded from macro 'ON_BLOCK_EXIT'
#define ON_BLOCK_EXIT ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeGuard
                                                    ^
../scopeguard.h:315:45: note: expanded from macro 'ANONYMOUS_VARIABLE'
#define ANONYMOUS_VARIABLE(str) CONCATENATE(str, __LINE__)
                                            ^
../scopeguard.h:314:48: note: expanded from macro 'CONCATENATE'
#define CONCATENATE(s1, s2) CONCATENATE_DIRECT(s1, s2)
                                               ^
../scopeguard.h:313:36: note: expanded from macro 'CONCATENATE_DIRECT'
#define CONCATENATE_DIRECT(s1, s2) s1##s2
                                   ^
<scratch space>:139:1: note: expanded from macro 'scopeGuard'
scopeGuard175
^
../node_xslt.cc:168:9: warning: unused variable 'scopeGuard168' [-Wunused-variable]
        ON_BLOCK_EXIT(xmlFreeDoc, result);
        ^
../scopeguard.h:317:53: note: expanded from macro 'ON_BLOCK_EXIT'
#define ON_BLOCK_EXIT ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeGuard
                                                    ^
../scopeguard.h:315:45: note: expanded from macro 'ANONYMOUS_VARIABLE'
#define ANONYMOUS_VARIABLE(str) CONCATENATE(str, __LINE__)
                                            ^
../scopeguard.h:314:48: note: expanded from macro 'CONCATENATE'
#define CONCATENATE(s1, s2) CONCATENATE_DIRECT(s1, s2)
                                               ^
../scopeguard.h:313:36: note: expanded from macro 'CONCATENATE_DIRECT'
#define CONCATENATE_DIRECT(s1, s2) s1##s2
                                   ^
<scratch space>:137:1: note: expanded from macro 'scopeGuard'
scopeGuard168
^
../node_xslt.cc:132:1: warning: unused variable '_argn' [-Wunused-variable]
FUNCTION(transform)
^
../macros.h:103:41: note: expanded from macro 'FUNCTION'
                                    int _argn=0;    \
                                        ^
../node_xslt.cc:152:5: warning: unused variable 'scopeGuard152' [-Wunused-variable]
    ON_BLOCK_EXIT(freeArray, params, array->Length());
    ^
../scopeguard.h:317:53: note: expanded from macro 'ON_BLOCK_EXIT'
#define ON_BLOCK_EXIT ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeGuard
                                                    ^
../scopeguard.h:315:45: note: expanded from macro 'ANONYMOUS_VARIABLE'
#define ANONYMOUS_VARIABLE(str) CONCATENATE(str, __LINE__)
                                            ^
../scopeguard.h:314:48: note: expanded from macro 'CONCATENATE'
#define CONCATENATE(s1, s2) CONCATENATE_DIRECT(s1, s2)
                                               ^
../scopeguard.h:313:36: note: expanded from macro 'CONCATENATE_DIRECT'
#define CONCATENATE_DIRECT(s1, s2) s1##s2
                                   ^
<scratch space>:135:1: note: expanded from macro 'scopeGuard'
scopeGuard152
^
../node_xslt.cc:154:23: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
    for (int i = 0; i < array->Length(); i++) {
                    ~ ^ ~~~~~~~~~~~~~~~
11 warnings generated.
  SOLINK_MODULE(target) Release/node_xslt.node
  SOLINK_MODULE(target) Release/node_xslt.node: Finished
node_xslt@0.1.8 node_modules/node_xslt

NodeJs 0.10.15 on MacOS 10.8.4. I intend to use this lib as a template engine in a production site. It would be great to have a clean and trustable lib to rely on.

thanks a bunch.

andreyvital commented 10 years ago

About the unused variable _argn, you can apply this patch at macros.h:

diff --git a/macros.h b/macros.h
index 195b3c7..df36348 100644
--- a/macros.h
+++ b/macros.h
@@ -100,7 +100,7 @@ using namespace v8;
 #define FUNCTION_DECL(f)        static v8::Handle<v8::Value> f(const v8::Arguments&);
 #define FUNCTION(f,...)         static v8::Handle<v8::Value> f(const v8::Arguments& args) { \
                                     v8::HandleScope handlescope; \
-                                    int _argn=0;    \
+                                     \
                                     __VA_ARGS__;
 #define FUNCTION_C(f)           static v8::Handle<v8::Value> f(const v8::Arguments& args) {
 #define END                     }
christopher5106 commented 9 years ago

Same warnings for me