@@ -114,6 +114,13 @@ py::object get_uuid_class() {
114114
115115// Struct to hold parameter information for binding. Used by SQLBindParameter.
116116// This struct is shared between C++ & Python code.
117+ // Suppress -Wattributes warning for ParamInfo struct
118+ // The warning is triggered because pybind11 handles visibility attributes automatically,
119+ // and having additional attributes on the struct can cause conflicts on Linux with GCC
120+ #ifdef __GNUC__
121+ #pragma GCC diagnostic push
122+ #pragma GCC diagnostic ignored "-Wattributes"
123+ #endif
117124struct ParamInfo {
118125 SQLSMALLINT inputOutputType;
119126 SQLSMALLINT paramCType;
@@ -124,6 +131,9 @@ struct ParamInfo {
124131 bool isDAE = false ; // Indicates if we need to stream
125132 py::object dataPtr;
126133};
134+ #ifdef __GNUC__
135+ #pragma GCC diagnostic pop
136+ #endif
127137
128138// Mirrors the SQL_NUMERIC_STRUCT. But redefined to replace val char array
129139// with std::string, because pybind doesn't allow binding char array.
@@ -748,23 +758,23 @@ SQLRETURN BindParameters(SQLHANDLE hStmt, const py::list& params,
748758 }
749759 SQL_NUMERIC_STRUCT* numericPtr = reinterpret_cast <SQL_NUMERIC_STRUCT*>(dataPtr);
750760 rc = SQLSetDescField_ptr (hDesc, 1 , SQL_DESC_PRECISION,
751- ( SQLPOINTER) numericPtr->precision , 0 );
761+ reinterpret_cast < SQLPOINTER>( static_cast < uintptr_t >( numericPtr->precision )) , 0 );
752762 if (!SQL_SUCCEEDED (rc)) {
753763 LOG (" BindParameters: SQLSetDescField(SQL_DESC_PRECISION) "
754764 " failed for param[%d] - SQLRETURN=%d" ,
755765 paramIndex, rc);
756766 return rc;
757767 }
758768
759- rc = SQLSetDescField_ptr (hDesc, 1 , SQL_DESC_SCALE, ( SQLPOINTER) numericPtr->scale , 0 );
769+ rc = SQLSetDescField_ptr (hDesc, 1 , SQL_DESC_SCALE, reinterpret_cast < SQLPOINTER>( static_cast < intptr_t >( numericPtr->scale )) , 0 );
760770 if (!SQL_SUCCEEDED (rc)) {
761771 LOG (" BindParameters: SQLSetDescField(SQL_DESC_SCALE) failed "
762772 " for param[%d] - SQLRETURN=%d" ,
763773 paramIndex, rc);
764774 return rc;
765775 }
766776
767- rc = SQLSetDescField_ptr (hDesc, 1 , SQL_DESC_DATA_PTR, ( SQLPOINTER) numericPtr, 0 );
777+ rc = SQLSetDescField_ptr (hDesc, 1 , SQL_DESC_DATA_PTR, reinterpret_cast < SQLPOINTER>( numericPtr) , 0 );
768778 if (!SQL_SUCCEEDED (rc)) {
769779 LOG (" BindParameters: SQLSetDescField(SQL_DESC_DATA_PTR) failed "
770780 " for param[%d] - SQLRETURN=%d" ,
0 commit comments