external/coinmp/UnpackedTarball_coinmp.mk |    1 
 external/coinmp/nullptr.patch             |  110 ++++++++++++++++++++++++++++++
 2 files changed, 111 insertions(+)

New commits:
commit 447e22b6f77deae3d66ea1fb823c2ec9b9e5dcbe
Author:     Andras Timar <[email protected]>
AuthorDate: Wed Feb 18 12:50:02 2026 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Thu Feb 19 08:50:00 2026 +0100

    external: CoinMP, reinterpret_cast<T*>(NULL) -> static_cast
    
    GCC 14 as shipped by Alpine 3.21 defines NULL with type
    std::nullptr_t, and reinterpret_cast cannot cast from nullptr_t
    to pointer types per the C++ standard:
    
      ClpModel.cpp:3848:24: error: invalid cast from type
      'std::nullptr_t' to type 'const char*'
    
    Replace all reinterpret_cast<T*>(NULL) with static_cast<T*>(nullptr)
    across Cbc, Cgl, Clp, and CoinUtils.
    
    Change-Id: Ie7c3a2f1b4d6e8a0c5f9d3b7e1a4c8f2d6b0e3a7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199613
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/external/coinmp/UnpackedTarball_coinmp.mk 
b/external/coinmp/UnpackedTarball_coinmp.mk
index 2c4ffd004275..556d08cc06bd 100644
--- a/external/coinmp/UnpackedTarball_coinmp.mk
+++ b/external/coinmp/UnpackedTarball_coinmp.mk
@@ -58,6 +58,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,coinmp,\
        external/coinmp/const.patch.1 \
        external/coinmp/const2.patch.1 \
        external/coinmp/const3.patch.1 \
+       external/coinmp/nullptr.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/coinmp/nullptr.patch b/external/coinmp/nullptr.patch
new file mode 100644
index 000000000000..7d8e5789b90f
--- /dev/null
+++ b/external/coinmp/nullptr.patch
@@ -0,0 +1,110 @@
+--- Cbc/src/CbcModel.cpp
++++ Cbc/src/CbcModel.cpp
+@@ -5363,7 +5363,7 @@
+         OsiClpSolverInterface * clpSolver
+         = dynamic_cast<OsiClpSolverInterface *> (solver_);
+         if (clpSolver)
+-            clpSolver->setFakeObjective(reinterpret_cast<double *> (NULL));
++            clpSolver->setFakeObjective(static_cast<double *>(nullptr));
+     }
+ #endif
+     moreSpecialOptions_ = saveMoreSpecialOptions;
+--- Cgl/src/CglLandP/CglLandPUtils.hpp
++++ Cgl/src/CglLandP/CglLandPUtils.hpp
+@@ -85,7 +85,7 @@
+     /** resize vector.*/
+     void resize(unsigned int i)
+     {
+-        cuts_.resize(i, reinterpret_cast<OsiRowCut *> (NULL));
++        cuts_.resize(i, static_cast<OsiRowCut *>(nullptr));
+     }
+ private:
+     /** Stores the number of cuts.*/
+--- Clp/src/AbcSimplex.cpp
++++ Clp/src/AbcSimplex.cpp
+@@ -368,19 +368,19 @@
+     // say Steepest pricing
+     abcDualRowPivot_ = new AbcDualRowSteepest();
+     abcPrimalColumnPivot_ = new AbcPrimalColumnSteepest();
+-    internalStatus_ = newArray(reinterpret_cast<unsigned char *>(NULL),
++    internalStatus_ = newArray(static_cast<unsigned char *>(nullptr),
+                              sizeArray+maximumNumberTotal_);
+-    abcLower_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+-    abcUpper_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+-    abcCost_ = newArray(reinterpret_cast<double 
*>(NULL),sizeArray+maximumNumberTotal_);
+-    abcDj_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+-    abcSolution_ = newArray(reinterpret_cast<double 
*>(NULL),sizeArray+maximumNumberTotal_);
+-    //fromExternal_ = newArray(reinterpret_cast<int *>(NULL),sizeArray);
+-    //toExternal_ = newArray(reinterpret_cast<int *>(NULL),sizeArray);
+-    scaleFromExternal_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+-    offset_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+-    abcPerturbation_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+-    abcPivotVariable_ = newArray(reinterpret_cast<int 
*>(NULL),maximumAbcNumberRows_);
++    abcLower_ = newArray(static_cast<double *>(nullptr),sizeArray);
++    abcUpper_ = newArray(static_cast<double *>(nullptr),sizeArray);
++    abcCost_ = newArray(static_cast<double 
*>(nullptr),sizeArray+maximumNumberTotal_);
++    abcDj_ = newArray(static_cast<double *>(nullptr),sizeArray);
++    abcSolution_ = newArray(static_cast<double 
*>(nullptr),sizeArray+maximumNumberTotal_);
++    //fromExternal_ = newArray(static_cast<int *>(nullptr),sizeArray);
++    //toExternal_ = newArray(static_cast<int *>(nullptr),sizeArray);
++    scaleFromExternal_ = newArray(static_cast<double *>(nullptr),sizeArray);
++    offset_ = newArray(static_cast<double *>(nullptr),sizeArray);
++    abcPerturbation_ = newArray(static_cast<double *>(nullptr),sizeArray);
++    abcPivotVariable_ = newArray(static_cast<int 
*>(nullptr),maximumAbcNumberRows_);
+     // Fill perturbation array
+     setupPointers(maximumAbcNumberRows_,maximumAbcNumberColumns_);
+     fillPerturbation(0,maximumNumberTotal_);
+@@ -554,19 +554,19 @@
+   subProblem->maximumNumberTotal_= maximumAbcNumberRows_+numberColumns;
+   subProblem->numberTotalWithoutFixed_= subProblem->numberTotal_;
+   int sizeArray=2*subProblem->maximumNumberTotal_+maximumAbcNumberRows_;
+-  subProblem->internalStatus_ = newArray(reinterpret_cast<unsigned char 
*>(NULL),
++  subProblem->internalStatus_ = newArray(static_cast<unsigned char 
*>(nullptr),
+                                        
sizeArray+subProblem->maximumNumberTotal_);
+-  subProblem->abcLower_ = newArray(reinterpret_cast<double 
*>(NULL),sizeArray);
+-  subProblem->abcUpper_ = newArray(reinterpret_cast<double 
*>(NULL),sizeArray);
+-  subProblem->abcCost_ = newArray(reinterpret_cast<double 
*>(NULL),sizeArray+subProblem->maximumNumberTotal_);
+-  subProblem->abcDj_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+-  subProblem->abcSolution_ = newArray(reinterpret_cast<double 
*>(NULL),sizeArray+subProblem->maximumNumberTotal_);
+-  //fromExternal_ = newArray(reinterpret_cast<int *>(NULL),sizeArray);
+-  //toExternal_ = newArray(reinterpret_cast<int *>(NULL),sizeArray);
+-  subProblem->scaleFromExternal_ = newArray(reinterpret_cast<double 
*>(NULL),sizeArray);
+-  subProblem->offset_ = newArray(reinterpret_cast<double *>(NULL),sizeArray);
+-  subProblem->abcPerturbation_ = newArray(reinterpret_cast<double 
*>(NULL),sizeArray);
+-  subProblem->abcPivotVariable_ = newArray(reinterpret_cast<int 
*>(NULL),maximumAbcNumberRows_);
++  subProblem->abcLower_ = newArray(static_cast<double *>(nullptr),sizeArray);
++  subProblem->abcUpper_ = newArray(static_cast<double *>(nullptr),sizeArray);
++  subProblem->abcCost_ = newArray(static_cast<double 
*>(nullptr),sizeArray+subProblem->maximumNumberTotal_);
++  subProblem->abcDj_ = newArray(static_cast<double *>(nullptr),sizeArray);
++  subProblem->abcSolution_ = newArray(static_cast<double 
*>(nullptr),sizeArray+subProblem->maximumNumberTotal_);
++  //fromExternal_ = newArray(static_cast<int *>(nullptr),sizeArray);
++  //toExternal_ = newArray(static_cast<int *>(nullptr),sizeArray);
++  subProblem->scaleFromExternal_ = newArray(static_cast<double 
*>(nullptr),sizeArray);
++  subProblem->offset_ = newArray(static_cast<double *>(nullptr),sizeArray);
++  subProblem->abcPerturbation_ = newArray(static_cast<double 
*>(nullptr),sizeArray);
++  subProblem->abcPivotVariable_ = newArray(static_cast<int 
*>(nullptr),maximumAbcNumberRows_);
+   subProblem->setupPointers(maximumAbcNumberRows_,numberColumns);
+   // could use arrays - but for now be safe
+   int * backward = new int [numberFullColumns+numberRows_];
+--- Clp/src/ClpModel.cpp
++++ Clp/src/ClpModel.cpp
+@@ -3845,7 +3845,7 @@
+      writer.setMpsData(*(matrix_->getPackedMatrix()), COIN_DBL_MAX,
+                        getColLower(), getColUpper(),
+                        objective,
+-                       reinterpret_cast<const char*> (NULL) /*integrality*/,
++                       static_cast<const char*>(nullptr) /*integrality*/,
+                        getRowLower(), getRowUpper(),
+                        columnNames, rowNames);
+      // Pass in array saying if each variable integer
+--- Clp/src/OsiClp/OsiClpSolverInterface.cpp
++++ Clp/src/OsiClp/OsiClpSolverInterface.cpp
+@@ -1448,7 +1448,7 @@
+   if (stopPrinting) {
+     CoinMessages * messagesPointer = modelPtr_->messagesPointer();
+     // won't even build messages 
+-    messagesPointer->setDetailMessages(100,10000,reinterpret_cast<int *> 
(NULL));
++    messagesPointer->setDetailMessages(100,10000,static_cast<int *>(nullptr));
+   }
+ #endif
+ }

Reply via email to