[PATCH] D42268: Add more initializers to quiet a clang warning

Roman Tereshin via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 17:30:20 PST 2018


+ llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>

Whoops, didn't specify the repository first time around.

> On Jan 18, 2018, at 3:54 PM, Roman Tereshin via Phabricator <reviews at reviews.llvm.org> wrote:
> 
> rtereshin created this revision.
> rtereshin added a reviewer: qcolombet.
> 
> `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.
> 
> 
> https://reviews.llvm.org/D42268
> 
> Files:
>  lib/Support/PrettyStackTrace.cpp
> 
> 
> Index: lib/Support/PrettyStackTrace.cpp
> ===================================================================
> --- lib/Support/PrettyStackTrace.cpp
> +++ lib/Support/PrettyStackTrace.cpp
> @@ -88,7 +88,11 @@
> 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__
> 
> 
> <D42268.130506.patch>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180118/eb1fa9a3/attachment.html>


More information about the llvm-commits mailing list