From patchwork Tue Nov 21 12:20:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 119348 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5189585qgn; Tue, 21 Nov 2017 04:20:34 -0800 (PST) X-Google-Smtp-Source: AGs4zMZnTHIaQAQkfShHezMe7xrkLyXhCuE/smnQ3aYjz/P1q+IbytY5GlqVhUabsEtRboUwoYad X-Received: by 10.101.78.210 with SMTP id w18mr16659085pgq.337.1511266834787; Tue, 21 Nov 2017 04:20:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511266834; cv=none; d=google.com; s=arc-20160816; b=hZKgwOE4Nbg+4IeDdH6SOxO5LcQsB4+30a65FSmUNgJNFtMIkIJs3CAg85VCkAsReU oUQGT4/fSBwFCLfQ2NnnJs+Int+lJSLwRVtMMiGysmboC3Sz4DOfASg8hDXDbhqcSoQo 0mXT8WpU5koE+4WnCGQxGPfQPDoHDCJKbJ+uG1+zEeTq42d6BXLgvw/gU9qij7ptVfH6 e3A8j8IFbBRnhwZhcXzrNaeN5vkXt27Q7GIopnDIC9QUHhSj82DHWQzkDFIWnY1Bsv3b sadP756OzCIwT83JJKu9FJNUwMs1mtKeCindut8N989/7CeILy3b2oUHVtSIxXcsh+ik Uijw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature:arc-authentication-results; bh=IYkNAqWRcWawCSTw5kz7Y59KNdWQar0kTsUmzv0gW/s=; b=ofS6WUhQlRFMB2muZIZVQOy8nKZyNkkHUcmZCUJZjrV8b3OuLAtabTCR0gZDZdJ+TW 8vZYHenXdaEqQEWvsInS5TefUCgSvzDXKlYkklhdDWuQg5dSKMs0dSUQimNU7j/uI0mC wav9cl5VeAQxdg3xLeAr5/0lvaIJo51Y8KBUJzvIRFhFr8BVd+08GdwsxXiT1ehaz+Dq Ol7c4tqNWeWHiaxNbYcdK1OPCGTR+Yw4ZKZVX6K+n596/kvNRj8Q28VMr0zahr/6wXg7 wF8dsi8U7M7YCtWCLUVeeVVTGvtftluvO/sSGrKtNWSC6zU8rftq2RO/gSKbklFNj+B+ oL4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=i434b9A4; spf=pass (google.com: domain of libc-alpha-return-87349-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-87349-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 188si10517171pgd.438.2017.11.21.04.20.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Nov 2017 04:20:34 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-87349-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 header.s=default header.b=i434b9A4; spf=pass (google.com: domain of libc-alpha-return-87349-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-87349-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=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:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=RBe YngPrxfpxZm/tTfrTxYFYdxUjDIYk6hTdds9HZbtZ+iJ7wRZ1gX2FP10yT5C/Gib NwbOj6lLiIlwFoWewqDDNxKrY0r0Sl3HhvKuwqxuuL+Ua0Ysx0NLph+9MwHCuE2P 4Hiy1KnX5UolJ3bkwqfmm+NNs9zTW2TmtAPejfVk= 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:mime-version :content-type:content-transfer-encoding; s=default; bh=EqlGwGI89 WJm/jkwQuAESVW5dbA=; b=i434b9A4IKpDGFNDIXRApGqzSgESI4bjYDQQb8+lI DqdtR6VUS7QcrbzBLziL6n2i19LPKQkYiXEn0c4o6n+nmINPxlbZxwwxOFaCAE3b 51ksaJxD5tHSZ3ZCJAin74E4nfE7g/jZdMnbGZ5ZofYe8ixVmzND3KC8xlnE6OWj Hk= Received: (qmail 47726 invoked by alias); 21 Nov 2017 12:20:25 -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 47709 invoked by uid 89); 21 Nov 2017 12:20:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, KAM_SHORT, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=bracket, universal, HContent-Transfer-Encoding:8bit X-HELO: mail-qt0-f194.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=IYkNAqWRcWawCSTw5kz7Y59KNdWQar0kTsUmzv0gW/s=; b=fNpia5wGWoK3udSi2yXj/jBtM/W0HcU28wFNoChv/I8em6XhJ9F4MpYKxKVNAV5RgR /2UFiR8bqXI5qNTn8ShW+Qk4l6gtPI427T4Fc56ffjDviPNjppyh5jmJnn/nELuWH23Y C3lUEkfxs9uCA0+1qH0FVlEhUYTULvoEv0c0v005+sMw7MdriiyflFoTegdsMiRQVLxc 4r/yZIXj1D+ZhVOd1O4XJ8nJML9nt1wTtTLdY3ZAIjtnvhPk3TIEGTjPnkLx1fqXNXdp 6Mo2kWf4YjR19nniS9GD7mkyzSIFstp2ja3XkMenjbsiPQDAM8YV4BV0JAkzxAFisNEC 5CDw== X-Gm-Message-State: AJaThX47k0vbRQ58ZffXP+lG1RI6KayBYdBB2MUv8Ly4A43xipWYijQN /akJ3yIAsiXtfz4xr1G+bCD24Xdumss= X-Received: by 10.200.49.166 with SMTP id h35mr25983291qte.293.1511266820605; Tue, 21 Nov 2017 04:20:20 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH] nptl: Add workaround for ASSERT_PTHREAD_INTERNAL_SIZE with GCC 4.9 Date: Tue, 21 Nov 2017 10:20:13 -0200 Message-Id: <1511266813-5215-1-git-send-email-adhemerval.zanella@linaro.org> MIME-Version: 1.0 GCC 4.9 (the minimum current supported) emits an warning for universal zero initializer ({0}) on ASSERT_PTHREAD_INTERNAL_SIZE: pthread_attr_init.c: In function ‘__pthread_attr_init_2_1’: pthread_attr_init.c:37:3: error: missing braces around initializer [-Werror=missing-braces] ASSERT_PTHREAD_INTERNAL_SIZE (pthread_attr_t, struct pthread_attr); ^ pthread_attr_init.c:37:3: error: (near initialization for ‘(anonymous).__size’) [-Werror=missing-braces] It is fact GCC BZ#53119 [1] fixed in later version (GCC5+). Since current branch is closed and there is no indication it will be backports (comment #20 in same bug report) this patch fixes by using a double bracket to zero initialize the struct. Checked on x86_64-linux-gnu with GCC 7 and GCC 4.9. * nptl/pthreadP.h (ASSERT_PTHREAD_INTERNAL_SIZE): Add workarond for -Wmissing-braces on GCC 4.9. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119 Signed-off-by: Adhemerval Zanella --- ChangeLog | 5 +++++ nptl/pthreadP.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 1cc80b6..713000e 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -644,7 +644,7 @@ check_stacksize_attr (size_t st) "sizeof (" #type ") != " #size) #define ASSERT_PTHREAD_INTERNAL_SIZE(type, internal) \ - _Static_assert (sizeof ((type) { 0 }).__size >= sizeof (internal), \ + _Static_assert (sizeof ((type) { { 0 } }).__size >= sizeof (internal),\ "sizeof (" #type ".__size) < sizeof (" #internal ")") #define ASSERT_PTHREAD_STRING(x) __STRING (x)