<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/94366>94366</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-cl] Provide implicit declarations of `wmain`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
MisterDA
</td>
</tr>
</table>
<pre>
clang-cl warns that a declaration is missing for `wmain`:
```console
> clang-cl --version
clang version 17.0.3
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\Llvm\x64\bin
```
```c
#include <stdio.h>
int wmain(void) {
wprintf(L"Hello, world!");
return 0;
}
```
```console
> $ clang-cl -Wall -D_UNICODE test.c
test.c(3,5): warning: no previous prototype for function 'wmain' [-Wmissing-prototypes]
3 | int wmain(void) {
| ^
test.c(3,1): note: declare 'static' if the function is not intended to be used outside of this translation unit
3 | int wmain(void) {
| ^
| static
1 warning generated.
```
See also [Using `wmain` ยง The `wmain` function signature](https://learn.microsoft.com/en-us/cpp/c-language/using-wmain?view=msvc-170#the-wmain-function-signature) from Microsoft's documentation.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVF2PmzgU_TU3L1dEYL7CAw8zMNFWancrddo-Vo59Q7wydmSbZPrvVwYmk1bV7qpShMn9wMfn3GPuvRoMUQvlI5T9hk_hZF37QflArn_YHKz83grNzZAIjVfujMdw4gE5ShKaOx6UNag8jsp7ZQY8WodQpdeRKwNVCvkDpD2kr88qXX7CGm81rdH8CW-bJMmFnFfWLLk5jmsIs3qbbvMl88zdQAHyB3zZVd-qIjmL5KqMtFefjP4i1qqTIy5xtJJ0rD1br16W1DvjA9eaZK9cTHURbNl9dHZwfMS90uSh7D4o4ay3x4BflJ-4xk9hkspC2bGUsbmBLoquUHZfOii7Z2t17HuvLyOU3UtVQNkdlPmJg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