[all-commits] [llvm/llvm-project] 616a86: [llvm][Support] Fix missing field in WSADATA warning

David Spickett via All-commits all-commits at lists.llvm.org
Thu Dec 14 03:28:08 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 616a866bed70642b0bddf8885b541dacf7249c1b
      https://github.com/llvm/llvm-project/commit/616a866bed70642b0bddf8885b541dacf7249c1b
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2023-12-14 (Thu, 14 Dec 2023)

  Changed paths:
    M llvm/lib/Support/raw_ostream.cpp

  Log Message:
  -----------
  [llvm][Support] Fix missing field in WSADATA warning

```
[136/6185] Building CXX object lib\Support\CMakeFiles\LLVMSupport.dir\raw_ostream.cpp.obj
C:\Work\david.spickett\llvm-project\llvm\lib\Support\raw_ostream.cpp(977,23): warning: missing field 'wHighVersion' initializer [-Wmissing-field-initializers]
  977 |   WSADATA WsaData = {0};
      |                       ^
```

According to
https://learn.microsoft.com/en-us/windows/win32/api/winsock/ns-winsock-wsadata
this can have any number of fields depending on some ifdefs,
so I've replaced `{0}` with a memset of whatever the size happens to be.

Probably doesn't matter for correctness anyway, but the compiler
won't see it used uninitialised at least.




More information about the All-commits mailing list