[llvm] r323777 - Add more initializers to quiet a clang warning
Daniel Sanders via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 08:02:33 PST 2018
Author: dsanders
Date: Tue Jan 30 08:02:32 2018
New Revision: 323777
URL: http://llvm.org/viewvc/llvm-project?rev=323777&view=rev
Log:
Add more initializers to quiet a clang warning
Summary:
`struct crashreporter_annotations_t` gained one more `uint64_t` field in
`CRASHREPORTER_ANNOTATIONS_VERSION` 5
causing an annoying clang warning:
```
llvm/lib/Support/PrettyStackTrace.cpp:92:65: warning: missing field 'abort_cause' initializer [-Wmissing-field-initializers]
= { CRASHREPORTER_ANNOTATIONS_VERSION, 0, 0, 0, 0, 0, 0 };
^
1 warning generated
```
Let's fix it.
Patch by Roman Tereshin
Reviewers: qcolombet, echristo, beanz, dexonsmith
Reviewed By: echristo
Subscribers: dsanders, dexonsmith, beanz, echristo, qcolombet, llvm-commits
Differential Revision: https://reviews.llvm.org/D42268
Modified:
llvm/trunk/lib/Support/PrettyStackTrace.cpp
Modified: llvm/trunk/lib/Support/PrettyStackTrace.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/PrettyStackTrace.cpp?rev=323777&r1=323776&r2=323777&view=diff
==============================================================================
--- llvm/trunk/lib/Support/PrettyStackTrace.cpp (original)
+++ llvm/trunk/lib/Support/PrettyStackTrace.cpp Tue Jan 30 08:02:32 2018
@@ -88,7 +88,11 @@ extern "C" {
CRASH_REPORTER_CLIENT_HIDDEN
struct crashreporter_annotations_t gCRAnnotations
__attribute__((section("__DATA," CRASHREPORTER_ANNOTATIONS_SECTION)))
+#if CRASHREPORTER_ANNOTATIONS_VERSION < 5
= { CRASHREPORTER_ANNOTATIONS_VERSION, 0, 0, 0, 0, 0, 0 };
+#else
+ = { CRASHREPORTER_ANNOTATIONS_VERSION, 0, 0, 0, 0, 0, 0, 0 };
+#endif
}
#elif defined(__APPLE__) && HAVE_CRASHREPORTER_INFO
extern "C" const char *__crashreporter_info__
More information about the llvm-commits
mailing list