Menu

#1167 Fails to build on macOS Sonoma (BSD iconv.h)

Fixed
None
Medium
Defect
2024-08-30
2024-08-29
Michael Cho
No

I was looking into QMMP build failure on macOS Sonoma in Homebrew - https://github.com/Homebrew/homebrew-core/pull/182862

The error is:

/tmp/qmmp-20240828-19582-sf4k85/qmmp-2.1.9/src/qmmp/qmmptextcodec.h:28:15: error: typedef redefinition with different types ('void *' vs 'struct __tag_iconv_t *')

This appears to be due to BSD iconv.h (which Apple switched to in macOS 14 Sonoma) having a different definition of iconv_t:

struct __tag_iconv_t;
typedef struct __tag_iconv_t    *iconv_t;

Is there a specific reason for the typedef in https://sourceforge.net/p/qmmp-dev/code/HEAD/tree/trunk/qmmp/src/qmmp/qmmptextcodec.h#l28 ?

Specifically, why not use #include <iconv.h> ?

Based on https://pubs.opengroup.org/onlinepubs/009695399/basedefs/iconv.h.html, POSIX does not restrict the type of iconv_t but it must exist to be compliant.

Discussion

  • trialuser02

    trialuser02 - 2024-08-30
    • status: New --> Fixed
    • assigned_to: trialuser02
     
  • trialuser02

    trialuser02 - 2024-08-30

    Fixed by [r11774]. Thank you!

     

    Related

    Commit: [r11774]


Log in to post a comment.

MongoDB Logo MongoDB