[PATCH 2/2] Profile2: use an implicit initializer for a struct array

Dirk Hohndel dirk at hohndel.org
Mon Mar 10 09:24:08 PDT 2014


On Mon, 2014-03-10 at 13:43 +0200, Lubomir I. Ivanov wrote:
> From: "Lubomir I. Ivanov" <neolit123 at gmail.com>
> 
> Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
> ---
> 
> last warning from -Wall with 4.4.0.
> ---
>  qt-ui/profile/diveprofileitem.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
> index 454fab0..b84f292 100644
> --- a/qt-ui/profile/diveprofileitem.cpp
> +++ b/qt-ui/profile/diveprofileitem.cpp
> @@ -229,7 +229,7 @@ void DiveHeartrateItem::modelDataChanged(const QModelIndex &topLeft, const QMode
>  	struct {
>  		int sec;
>  		int hr;
> -	} hist[3] = { 0 };
> +	} hist[3] = {};

I'll ask our resident compiler and language standards guru (Thiago) to
chime in here. I thought that the ISO standard requires the initializer
to be non-empty and that the '{}' initializer was a gcc-ism.

/D



More information about the subsurface mailing list