vorbis-tools icon indicating copy to clipboard operation
vorbis-tools copied to clipboard

[mingw64] clang 15 errors due to getopt_long

Open 1480c1 opened this issue 1 year ago • 0 comments

log:

../../oggenc/oggenc.c:735:30: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'int (*)'; take the address with & [-Wint-conversion]
    while((ret = getopt_long(argc, argv, "a:b:B:c:C:d:G:hkl:L:m:M:n:N:o:P:q:QrR:s:t:VX:Y:",
                             ^~~~
                             &
../../include/getopt.h:140:29: note: passing argument to parameter '_imp____argc' here
extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
                            ^
D:/mabs/msys64/mingw32/include/stdlib.h:283:19: note: expanded from macro '__argc'
#define __argc (* __MINGW_IMP_SYMBOL(__argc))
                  ^
D:/mabs/msys64/mingw32/include/_mingw_mac.h:124:35: note: expanded from macro '__MINGW_IMP_SYMBOL'
#  define __MINGW_IMP_SYMBOL(sym) _imp__##sym
                                  ^
<scratch space>:40:1: note: expanded from here
_imp____argc
^
../../oggenc/oggenc.c:735:36: warning: incompatible pointer types passing 'char **' to parameter of type 'char *const *(*(*)())' [-Wincompatible-pointer-types]
    while((ret = getopt_long(argc, argv, "a:b:B:c:C:d:G:hkl:L:m:M:n:N:o:P:q:QrR:s:t:VX:Y:",
                                   ^~~~
../../include/getopt.h:140:50: note: passing argument to parameter '__p___argv' here
extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
                                                 ^
D:/mabs/msys64/mingw32/include/stdlib.h:287:19: note: expanded from macro '__argv'
#define __argv  (* __p___argv())
                   ^

it seems the double underscored versions are mentioned in https://learn.microsoft.com/en-us/cpp/c-runtime-library/argc-argv-wargv?view=msvc-170

1480c1 avatar Sep 26 '22 02:09 1480c1