https://bugs.documentfoundation.org/show_bug.cgi?id=155715

            Bug ID: 155715
           Summary: Missing #include <cstdlib> in
                    store/source/storbase.hxx required to build with gcc
                    14
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

Description:
With (the development version of) GCC 14 (after commit
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=940645cec50 ), building
of Libre Office (master commit 86828ea2e323) fails with:

In file included from
/home/mjambor/lo/libreoffice/store/source/storpage.hxx:27,
                 from
/home/mjambor/lo/libreoffice/store/source/storpage.cxx:20:
/home/mjambor/lo/libreoffice/store/source/storbase.hxx: In static member
function ‘static void* store::OStorePageObject::operator new(size_t)’:
/home/mjambor/lo/libreoffice/store/source/storbase.hxx:525:21: error: ‘malloc’
is not a member of ‘std’
  525 |         return std::malloc(sal_uInt32(n));
      |                     ^~~~~~
/home/mjambor/lo/libreoffice/store/source/storbase.hxx: In static member
function ‘static void store::OStorePageObject::operator delete(void*)’:
/home/mjambor/lo/libreoffice/store/source/storbase.hxx:529:14: error: ‘free’ is
not a member of ‘std’
  529 |         std::free (p);


Adding the missing include allows the compilation to proceed further:


mjambor@ryzen4:~/lo/libreoffice$ git diff
diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx
index feac0db96227..207cbf40a8d3 100644
--- a/store/source/storbase.hxx
+++ b/store/source/storbase.hxx
@@ -32,6 +32,7 @@

 #include <store/types.h>

+#include <cstdlib>
 #include <memory>
 #include <utility>



Steps to Reproduce:
1.Build gcc from the master branch and install it somewhere
2.Set the PATH to where you installed the gcc from step 1
3.Try to build LibreOffice and ponder about the build failure

Actual Results:
Build failure

Expected Results:
Build succeeds


Reproducible: Always


User Profile Reset: No

Additional Info:
Cheetah is the fastest mammal on the planet, they say.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to