From patchwork Fri Aug 26 20:58:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 663244 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sLYLc2d83z9sDG for ; Sat, 27 Aug 2016 06:59:04 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=Up7dxrK7; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=fA87W25aKEPEk41IFr2KasOTUqEObugncLeXwKfte0h/GgMyCjtPl X53kcw/zAkdUMbG3MfmqO7viIdAuahtZ6topFJDcv7MUCs4b6o3hgcYrbiUWhrng sGm+cNXdw5ShKYhDB7o9yEaccIU6k8jpAu5HNsg3dzdL5Pc+Qq+qxw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=fyoXWULyn/wofYy90aqKFxfEqoU=; b=Up7dxrK7vf5d0xWJmGyvAiQHck16 Z219YS+D/TCZJlkyzF327R0lDfRNv6zZA8lOEnHaDtAXuAJe6jWKq+1NS/gvvGtc 91MRsSjyOBgAQblhMRNF6qPMT4YaduM0U6JLx0PIS23EaQ4Rq1bI9Ym8+W4hp5Wp YTYEJ4Nrqp/S62k= Received: (qmail 69780 invoked by alias); 26 Aug 2016 20:58:58 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 69769 invoked by uid 89); 26 Aug 2016 20:58:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=spilled, uintptr_t, seconds_as_ptr, *seconds_as_ptr X-HELO: mail-yw0-f177.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=+6iQvnmb5StUNB4Qlt+iebEyig2Av6r0m+4e88qgzX4=; b=ZV32SIKjj6FvmUWZPaJUu/o9huEcQ8PXpTob9Ur+e25oVZTzkopschXEgZaFjF6FPR QQpYSqJYW/53HPNqJ3eBvGNg6yu4BICoLSQ5/FuJlCwGJrpdpLp4Q0nkquk6pVbQf+Un 0KUbf8tL7Etb+OnK8NVclSRwbKUB9CgyPgmaWD+QTb3oShLe1nPrqShF3aw/yVA2ZDvW d18QJGysnw8EFbeC26lVZqsKzg8DEX5UuvnBDrqqHDwjuG8Xs5A7G/nL4vGF8ME9sg5K 0gDOvT+GubznW/b5ZEWXppocuSfY0Lly2PV4A1M+bVXkNDpUU4EzhQKNVNDoNUiCM0Ff nFJg== X-Gm-Message-State: AE9vXwO8YqruA7FEYRDb9gNs+Ws6pO8bdyuef20jls35uSkimtZ0ZyVWQHBj3yeheeF+wLY0 X-Received: by 10.129.71.9 with SMTP id u9mr5375873ywa.115.1472245126600; Fri, 26 Aug 2016 13:58:46 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [COMMITTED] Fix test-skeleton C99 designed initialization Date: Fri, 26 Aug 2016 17:58:40 -0300 Message-Id: <1472245120-18961-1-git-send-email-adhemerval.zanella@linaro.org> ISO C forbids empty initializer braces (6.7.9 initializer-list must contain at least one initializer). However GCC allows it, generating a warning depending of the version. With GCC 4.8 on ARM I noticed tst-initializers1.c fails to build with: In file included from tst-initializers1.c:60:0: ../test-skeleton.c: In function 'delayed_exit_thread': ../test-skeleton.c:687:10: error: missing initializer for field 'tv_sec' of 'struct timespec' [-Werror=missing-field-initializers] struct timespec remaining = {} While with GCC 5.1 the same warning is just spilled with -pedantic. To be safe this patch just zero initialize the struct as expected. Tested on armhf. * test-skeleton.c (delayed_exit_thread): Add initializer on struct timespec C99 designated initialization. --- test-skeleton.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test-skeleton.c b/test-skeleton.c index b24ce1d..913a335 100644 --- a/test-skeleton.c +++ b/test-skeleton.c @@ -684,7 +684,7 @@ delayed_exit_thread (void *seconds_as_ptr) { int seconds = (uintptr_t) seconds_as_ptr; struct timespec delay = { seconds, 0 }; - struct timespec remaining = {}; + struct timespec remaining = { 0 }; if (nanosleep (&delay, &remaining) != 0) { printf ("error: nanosleep: %m\n");