diff -burr eccodes-2.39.0-Source-orig/fortran/grib_fortran.cc eccodes-2.39.0-Source/fortran/grib_fortran.cc
--- eccodes-2.39.0-Source-orig/fortran/grib_fortran.cc	2025-01-31 21:13:24.922349600 -0700
+++ eccodes-2.39.0-Source/fortran/grib_fortran.cc	2025-01-31 21:19:58.023218200 -0700
@@ -26,6 +26,7 @@
 #endif
 
 #include <ctype.h>
+#include <unistd.h>
 
 /* Have file ids distinct from GRIB/BUFR ids, in order to be
  * protected against user errors where a file id is given
@@ -951,7 +952,7 @@
                 grib_context_log(context,GRIB_LOG_FATAL,"grib_f_open_file_: posix_memalign unable to allocate io_buffer\n");
             }
 #else
-            iobuf = (void*)malloc(context->io_buffer_size);
+            iobuf = (char*)malloc(context->io_buffer_size);
             if (!iobuf) {
                 grib_context_log(context,GRIB_LOG_FATAL,"grib_f_open_file_: Unable to allocate io_buffer\n");
             }
