Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mingw64] clang 15 errors due to getopt_long #38

Open
1480c1 opened this issue Sep 26, 2022 · 0 comments · May be fixed by #39
Open

[mingw64] clang 15 errors due to getopt_long #38

1480c1 opened this issue Sep 26, 2022 · 0 comments · May be fixed by #39

Comments

@1480c1
Copy link

1480c1 commented Sep 26, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant