diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2017-12-21 09:03:24 -0800 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2017-12-22 00:26:46 -0800 |
commit | 82e1ef5d7dce5ef06cb02e3f51a7c660943d4f2c (patch) | |
tree | 0eb6e1175e35f13fe43e9271bdac43aaf92689cb | |
parent | eeacb675ab14ce294af988777f57124fb9e5539a (diff) |
DLL_interface: avoid undefined varg behavior
This fixes:
DLL_interface.cpp:187:19: error: passing an object that undergoes default
argument promotion to 'va_start'
has undefined behavior [-Werror,-Wvarargs]
va_start( args, aParamInfo ); // the element before the open param list
The fix works because bool can be converted to int (so old code still
works) while not being promoted (thus avoiding the undefined behavior).
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
-rwxr-xr-x | src/DB_interfaces/api_db/DLL_interface.cpp | 2 | ||||
-rwxr-xr-x | src/DB_interfaces/api_db/DLL_interface.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/DB_interfaces/api_db/DLL_interface.cpp b/src/DB_interfaces/api_db/DLL_interface.cpp index 9e173f2..5620133 100755 --- a/src/DB_interfaces/api_db/DLL_interface.cpp +++ b/src/DB_interfaces/api_db/DLL_interface.cpp @@ -169,7 +169,7 @@ TSyError ConnectModule( appPointer &aMod, cAppCharP aModName, bool is_jni ) TSyError ConnectFunctions( appPointer aMod, appPointer aField, memSize aFieldSize, - bool aParamInfo, ... ) + int aParamInfo, ... ) /* Connect to DLL <aDLLname> (or LIB if <aDLLname> = "") */ { TSyError err = LOCERR_OK; diff --git a/src/DB_interfaces/api_db/DLL_interface.h b/src/DB_interfaces/api_db/DLL_interface.h index 69cca59..de6f138 100755 --- a/src/DB_interfaces/api_db/DLL_interface.h +++ b/src/DB_interfaces/api_db/DLL_interface.h @@ -105,7 +105,7 @@ TSyError ConnectModule( appPointer &aMod, cAppCharP aModName, bool is_jni= false * <aParamInfo> must be true, if each element contains a second param with parameter info. */ TSyError ConnectFunctions( appPointer aMod, appPointer aField, memSize aFieldSize, - bool aParamInfo, ... ); + int aParamInfo, ... ); /*! Disconnect a connected unit |