[MacPorts] #70720: sox @14.4.2_4: error: incompatible function pointer types initializing 'sox_format_handler_seek' (aka 'int (*)(struct sox_format_t *, unsigned long)') with an expression of type 'int (sox_format_t *, uint64_t)' (aka 'int (struct sox_format_t *, unsigned long long)') [-Wincompatible-function-pointer-types]
MacPorts
noreply at macports.org
Tue Nov 5 10:55:18 UTC 2024
#70720: sox @14.4.2_4: error: incompatible function pointer types initializing
'sox_format_handler_seek' (aka 'int (*)(struct sox_format_t *, unsigned
long)') with an expression of type 'int (sox_format_t *, uint64_t)' (aka
'int (struct sox_format_t *, unsigned long long)') [-Wincompatible-
function-pointer-types]
-----------------------+---------------------
Reporter: tthoma24 | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.10.1
Resolution: | Keywords: sequoia
Port: sox |
-----------------------+---------------------
Comment (by jacobvosmaer):
This seems to work:
{{{
--- Portfile.orig 2024-11-05 11:45:10
+++ Portfile 2024-11-05 11:45:54
@@ -28,7 +28,8 @@
port:pkgconfig
patchfiles patch-curl.diff \
- yosemite-libtool.patch
+ yosemite-libtool.patch \
+ uint64_t.diff
platform darwin 11 {
# System grep fails: "grep: Regular expression too big"
}}}
Where uint64_t.diff is:
{{{
diff --git a/src/sox.h b/src/sox.h
index 155742e..520f5c4 100644
--- src/sox.h.orig
+++ src/sox.h
@@ -22,6 +22,7 @@ LSX_ and lsx_ symbols should not be used by libSoX-based
applications.
#include <limits.h>
#include <stdarg.h>
#include <stddef.h>
+#include <stdint.h>
#if defined(__cplusplus)
extern "C" {
@@ -458,13 +459,7 @@ typedef long long sox_int64_t;
Client API:
Unsigned 64-bit type. Typically defined as unsigned long or unsigned long
long.
*/
-#if ULONG_MAX==0xffffffffffffffff
-typedef unsigned long sox_uint64_t;
-#elif defined(_MSC_VER)
-typedef unsigned __int64 sox_uint64_t;
-#else
-typedef unsigned long long sox_uint64_t;
-#endif
+typedef uint64_t sox_uint64_t;
#ifndef _DOXYGEN_
lsx_static_assert(sizeof(sox_int8_t)==1, sox_int8_size);
}}}
My interpretation is that sox.h (which is public API and thus should be
changed carefully) intends to use uint64_t even on systems that don't have
stdint.h. That is why it contains its own uint64_t typedef and detection
macro. On macos we have stdint.h so we can simplify this.
--
Ticket URL: <https://trac.macports.org/ticket/70720#comment:8>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list