[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH] block/qapi: Fix Sparse warning
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-trivial] [PATCH] block/qapi: Fix Sparse warning |
Date: |
Tue, 10 Mar 2015 09:06:47 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 |
08.03.2015 01:16, Stefan Weil wrote:
> Sparse reports this warning:
>
> block/qapi.c:417:47: warning:
> too long initializer-string for array of char(no space for nul char)
>
> Replacing the string by an array of characters fixes this warning.
> - static const char suffixes[NB_SUFFIXES] = "KMGT";
> + static const char suffixes[NB_SUFFIXES] = {'K', 'M', 'G', 'T'};
The latter is a bit uglier to my taste but oh well, damn warnings! :)
Applied to -trivial, thanks!
/mjt