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
@ -80,8 +80,6 @@ endif()
|
||||
|
||||
if(ENABLE_UNICODE AND MINGW)
|
||||
target_link_libraries(${EXE_NAME} -municode)
|
||||
# GCC doesn't know about wmain
|
||||
set_source_files_properties(tool_main.c PROPERTIES COMPILE_FLAGS "-Wno-missing-prototypes -Wno-missing-declarations")
|
||||
endif()
|
||||
|
||||
source_group("curlX source files" FILES ${CURLX_CFILES})
|
||||
|
||||
@ -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…
Reference in New Issue
Block a user