mirror of
https://github.com/curl/curl.git
synced 2026-08-10 12:30:53 +03:00
src: silence wmain() warning for all build methods
llvm/clang and gcc doesn't recognize the wmain() function in Unicode
Windows builds:
llvm/clang:
```
../../src/tool_main.c:239:5: warning: no previous prototype for function 'wmain' [-Wmissing-prototypes]
int wmain(int argc, wchar_t *argv[])
^
1 warning generated.
```
gcc:
```
../../src/tool_main.c:239:5: warning: no previous prototype for 'wmain' [-Wmissing-prototypes]
239 | int wmain(int argc, wchar_t *argv[])
| ^~~~~
```
Before this patch, we already silenced it with CMake. This patch moves
the silencing to the source, so that it applies to all build tools.
Bug: https://github.com/curl/curl/issues/7229#issuecomment-1464806651
Reviewed-by: Marcel Raad
Closes #10744
This commit is contained in:
parent
c2b7249db2
commit
079079b2fd
2 changed files with 5 additions and 2 deletions
|
|
@ -236,6 +236,11 @@ static void main_free(struct GlobalConfig *config)
|
|||
** curl tool main function.
|
||||
*/
|
||||
#ifdef _UNICODE
|
||||
#if defined(__GNUC__)
|
||||
/* GCC doesn't know about wmain() */
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||
#endif
|
||||
int wmain(int argc, wchar_t *argv[])
|
||||
#else
|
||||
int main(int argc, char *argv[])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue