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: 74848 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp557334qga; Fri, 26 Aug 2016 13:59:07 -0700 (PDT) X-Received: by 10.98.204.74 with SMTP id a71mr9389113pfg.149.1472245147496; Fri, 26 Aug 2016 13:59:07 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id j80si23028963pfa.194.2016.08.26.13.59.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Aug 2016 13:59:07 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-72896-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-72896-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-72896-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org 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=eVS2Wov66yFX7fZ6Yb9NEbZIpb5FYIbZ13dMwPxmb+VuvZyI7/r9R A0E+j6EZ6yX9oYH60G1qS/9xRnBAtJI+iqv0pCHGyjHW0X9BfO/OgQi+yYtNOxQ7 FmV0W5ERTbgydAATK+AtIv70NgzVKe8otUFzZ+c1cNlCKfmNq0FNPg= 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=EyD8hHVWhjwwKJ1EYek3+U8psMDY 5SGaAx3Tkr46OXtao7tGxDZlVOD5EJ1SoxkTDZOaFlwv04RxOIcBk+O4XJi4GSJb k3ZEUmuSxO+7vqBhjF7moeqpLdxMUVL61cvCUpIsUWLTxvnmz22RdLB1PxibTJ++ mL7lPdkrXZQhQ94= 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(-) -- 2.7.4 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");