IBM / nodejs-idb-connector

A JavaScript (Node.js) library for communicating with Db2 for IBM i, with support for queries, procedures, and much more. Uses traditional callback-style syntax
MIT License
38 stars 23 forks source link

Fixup complier warnings #132

Closed abmusse closed 3 years ago

abmusse commented 3 years ago

When building from source we get a few compiler warnings and we should fix these up.

gmake: Entering directory '~/nodejs-idb-connector/build'
  CXX(target) Release/obj.target/db2ia/src/db2ia/db2ia.o
In file included from ../src/db2ia/dbconn.h:17:0,
                 from ../src/db2ia/db2ia.cc:10:
../src/db2ia/dberror.h:103:20: warning: 'const char* getSQLType(int)' defined but not used [-Wunused-function]
 static const char* getSQLType(int sqlType)
                    ^~~~~~~~~~
../src/db2ia/dberror.h:97:13: warning: 'bool SQLErrorEquals(int, SQLINTEGER, const char*, SQLINTEGER)' defined but not used [-Wunused-function]
 static bool SQLErrorEquals(int handleType, SQLINTEGER handle, const char *sqlState, SQLINTEGER sqlCode)
             ^~~~~~~~~~~~~~
../src/db2ia/dberror.h:90:13: warning: 'void throwCustomMsg(int, const char*, Napi::Env)' defined but not used [-Wunused-function]
 static void throwCustomMsg(int code, const char *msg, Napi::Env env)
             ^~~~~~~~~~~~~~
../src/db2ia/dberror.h:83:13: warning: 'void throwErrMsg(int, SQLINTEGER, Napi::Env)' defined but not used [-Wunused-function]
 static void throwErrMsg(int handleType, SQLINTEGER handle, Napi::Env env)
             ^~~~~~~~~~~
../src/db2ia/dberror.h:61:13: warning: 'void printErrorToLog(SQLINTEGER, char*)' defined but not used [-Wunused-function]
 static void printErrorToLog(SQLINTEGER handle, char msg[])
             ^~~~~~~~~~~~~~~
  CXX(target) Release/obj.target/db2ia/src/db2ia/dbconn.o
../src/db2ia/dbconn.cc: In member function 'Napi::Value DbConn::ValidStmt(const Napi::CallbackInfo&)':
../src/db2ia/dbconn.cc:388:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (outLen < sizeof(outSqlSt))
       ~~~~~~~^~~~~~~~~
../src/db2ia/dbconn.cc:393:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
In file included from ../src/db2ia/dbconn.h:17:0,
                 from ../src/db2ia/dbconn.cc:6:
../src/db2ia/dberror.h: At global scope:
../src/db2ia/dberror.h:103:20: warning: 'const char* getSQLType(int)' defined but not used [-Wunused-function]
 static const char* getSQLType(int sqlType)
                    ^~~~~~~~~~
../src/db2ia/dberror.h:97:13: warning: 'bool SQLErrorEquals(int, SQLINTEGER, const char*, SQLINTEGER)' defined but not used [-Wunused-function]
 static bool SQLErrorEquals(int handleType, SQLINTEGER handle, const char *sqlState, SQLINTEGER sqlCode)
             ^~~~~~~~~~~~~~
../src/db2ia/dberror.h:61:13: warning: 'void printErrorToLog(SQLINTEGER, char*)' defined but not used [-Wunused-function]
 static void printErrorToLog(SQLINTEGER handle, char msg[])
             ^~~~~~~~~~~~~~~
gmake: Warning: File '../src/db2ia/dbstmt.cc' has modification time 337 s in the future
  CXX(target) Release/obj.target/db2ia/src/db2ia/dbstmt.o
../src/db2ia/dbstmt.cc: In member function 'Napi::Value DbStmt::FetchSync(const Napi::CallbackInfo&)':
../src/db2ia/dbstmt.cc:1490:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
In file included from ../src/db2ia/dbconn.h:17:0,
                 from ../src/db2ia/dbstmt.h:8,
                 from ../src/db2ia/dbstmt.cc:6:
../src/db2ia/dberror.h: At global scope:
../src/db2ia/dberror.h:97:13: warning: 'bool SQLErrorEquals(int, SQLINTEGER, const char*, SQLINTEGER)' defined but not used [-Wunused-function]
 static bool SQLErrorEquals(int handleType, SQLINTEGER handle, const char *sqlState, SQLINTEGER sqlCode)
             ^~~~~~~~~~~~~~