From patchwork Wed Nov 13 12:14:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 1194234 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47Ck8H1rl2z9s7T for ; Wed, 13 Nov 2019 23:15:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="b2mfO/ni"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47Ck8G4ZDQzF79F for ; Wed, 13 Nov 2019 23:15:10 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::442; helo=mail-pf1-x442.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="b2mfO/ni"; dkim-atps=neutral Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47Ck845pzhzF6qy for ; Wed, 13 Nov 2019 23:15:00 +1100 (AEDT) Received: by mail-pf1-x442.google.com with SMTP id r4so1548195pfl.7 for ; Wed, 13 Nov 2019 04:15:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uSZ1Hn4fizEqjQwGvlxtCTORWFSHiYK+v7+3jWL/W9Y=; b=b2mfO/niy6uGPwBgoEqwItvs0imAlssFyJyyrG4nrNu/4k3JBVB+ZbWf+/cLzeujlB ZZjP/Zr/53qnJkxljd99dr7U5DXIcNcDIAXVKL/nb/KHmJQn+rWXpjQ1UHZaRzGKpt8C AZNcTREPkf/rkP5TlWoV1ance0Qo7dlV9GpGin87rsqJYgC5achAnAvWpCkTWazlzMt/ Lo2DlSw54hjViTk7ztyHtAyaJts31VTE8JqYhckx1z0NcDloauhBvVGYicqCIZB4MVUK vB2axR14yR2m9oQdYmxnokToNZuteCk+bRJuUW6/b3Run+QbaT7htBIG2ChHa78iExCr uLgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uSZ1Hn4fizEqjQwGvlxtCTORWFSHiYK+v7+3jWL/W9Y=; b=kH6WavMoTPguTulcZQO6O+69CBGtvXUdp7qV4OJ/4PJD7mvouLzx8b+ZDkcDylcOU3 zmqS/OPza4L9RsI5n1EvrOGEEYZmwWV3yCFhBFyd07vUeLK7fzIHiA2PfUZNHXHldwfd EtlJkz/u3SSi0IZ9aQjjvq+iA14rrTGIi4sPtQ0BnHi5NgI/6M90Dnc0QSpSswtm3pEk lXz9aHw583kpXKI3D/GNB5NSbaH1H5t+ZCfJ+cQx2zVFeouxj4NisfBej8KU3xh3aC72 Zp/gDK3q34VKJCP4PNQOVjG9rrr1Qmky9oIRMsaRki69Asla4P/YftayJPaaBIU+FHug mWMQ== X-Gm-Message-State: APjAAAXr8jy25wGowjFWCZyCiXxb+UoBrj5m/o4yYRPQcmJyGM7HSr6Y 83zOLlBlnyk+fo4dDOtuDCX5nnHcQTc= X-Google-Smtp-Source: APXvYqy/cHUq0GavKB4LIl6v3t+K894eqYVauXzgqaJm26XpbYCxVKsIzC2VdQqJqK56afn5nrT16Q== X-Received: by 2002:a62:38ca:: with SMTP id f193mr4114201pfa.163.1573647296530; Wed, 13 Nov 2019 04:14:56 -0800 (PST) Received: from 192-168-1-6.tpgi.com.au (14-200-204-163.tpgi.com.au. [14.200.204.163]) by smtp.gmail.com with ESMTPSA id s3sm2461172pjn.21.2019.11.13.04.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 04:14:55 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Wed, 13 Nov 2019 23:14:21 +1100 Message-Id: <20191113121422.20503-1-oohall@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 1/2] makefiles: Make attribute suggestions non-errors X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Different versions of GCC don't have different ideas about when the suggestion should be made. That, combined with -Werror being enabled results in spurious compilation failures for dumb reasons. They're also really annoying when tinkering. They do however make good suggestions on occasion so leave them enabled with -Wno-error enabled so they don't cause compile failures. Signed-off-by: Oliver O'Halloran --- Makefile.main | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile.main b/Makefile.main index 2d60bbbf5e41..4d7ebcec98d7 100644 --- a/Makefile.main +++ b/Makefile.main @@ -42,7 +42,9 @@ HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-std=gnu11) HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-m64) HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-Wjump-misses-init) \ $(call try-cflag,$(HOSTCC),-Wsuggest-attribute=const) \ - $(call try-cflag,$(HOSTCC),-Wsuggest-attribute=noreturn) + $(call try-cflag,$(HOSTCC),-Wsuggest-attribute=noreturn) \ + $(call try-cflag,$(HOSTCC),-Wno-error=suggest-attribute=const) \ + $(call try-cflag,$(HOSTCC),-Wno-error=suggest-attribute=noreturn) HOSTCFLAGS += -DDEBUG -DCCAN_LIST_DEBUG # We want small stack usage for skiboot @@ -126,6 +128,8 @@ endif CFLAGS += $(call try-cflag,$(CC),-Wjump-misses-init) \ $(call try-cflag,$(CC),-Wsuggest-attribute=const) \ $(call try-cflag,$(CC),-Wsuggest-attribute=noreturn) \ + $(call try-cflag,$(CC),-Wno-error=suggest-attribute=const) \ + $(call try-cflag,$(CC),-Wno-error=suggest-attribute=noreturn) \ $(call try-cflag,$(CC),-Wstack-usage=1024) \ $(call try-cflag,$(CC),-Wno-error=address-of-packed-member) From patchwork Wed Nov 13 12:14:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 1194235 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47Ck8w0gcpz9s7T for ; Wed, 13 Nov 2019 23:15:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hyZoHTan"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47Ck8v60t8zF7NQ for ; Wed, 13 Nov 2019 23:15:43 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::541; helo=mail-pg1-x541.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hyZoHTan"; dkim-atps=neutral Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47Ck863J2pzF6vM for ; Wed, 13 Nov 2019 23:15:02 +1100 (AEDT) Received: by mail-pg1-x541.google.com with SMTP id h4so1274478pgv.8 for ; Wed, 13 Nov 2019 04:15:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=822k5Epy3abApFDOTZu4ecH2CXFgELBLfTdDkDS98hQ=; b=hyZoHTan8aXM4sZC1YnZfORs06KAEtqll9EDRxYNt0+zXXe2Ib1kLj8y54WpuKvv6L vRU8zZ3eMqqgma9YpQPp6F3aZzh3hn27T8Zy4NMO2P+XYXgvr2BJw7pOc4DUTGRD+4EL EDsWt6irhEt+6SqwAArcKscKiU9crKoNMtDvfoyiYw6xzBsvV4HuEGTBpZ7CCdQC3BMP 2n/dcBdfkwBS3hUkSAVyIbjV3nrOqZD4LI2KvIMaSWLA75iXYOl/riF8vn2Q7VL/ZW50 xM2N2Qd/ex/p5OHVirMmRxCG7uJ0weUO9XOdpmu6Ptkjp7HT1K1jlCw7WeUanDSwHlYz amIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=822k5Epy3abApFDOTZu4ecH2CXFgELBLfTdDkDS98hQ=; b=tw4jOApasiD2Uenlyh2mR1X6HIRQ5zZeE4Onlwe3jY99Li2LrvzX2Tj7zf9GogVEFq S7HhtOwA3Qykgk3MwzWJLkyTrHWhUZ2VzHXUfwYpKHZg5FiGkIE+JDF3r3cpBtIf1YCa WD7prIgnDgO7Xt0op1i56FlISxRuVYYiX/A47KNyc7XGsAt75S4OwkJxO1azYfWGxZGb C4kGoo+3kI32//jI/OXyCd2YZSh9w7qMivij6E44gxo4AeATGc8xWPIyXZbEVQv4JKLt muNGkeUJXltcuBjif7UCa07nmTKPtv8jmn7iLakqJJYKUCEAfMf0HKIGnc+IAKMygRmj tO+w== X-Gm-Message-State: APjAAAWLgSMxh7Xeqnmgmc1R/GxnBwRFEvCpw9hYO4StXGQ7+PtEUVN0 6XqjEUje2lx32zMrLovZfvULJ13Y0ww= X-Google-Smtp-Source: APXvYqw/5GsUVQOdSyRVetJCLmdv+tqMNvdt+5JdIkMY400vCmZLPkeSRZE80menfz5tA9UuowMhGQ== X-Received: by 2002:a62:2b8b:: with SMTP id r133mr4134082pfr.7.1573647299269; Wed, 13 Nov 2019 04:14:59 -0800 (PST) Received: from 192-168-1-6.tpgi.com.au (14-200-204-163.tpgi.com.au. [14.200.204.163]) by smtp.gmail.com with ESMTPSA id s3sm2461172pjn.21.2019.11.13.04.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 04:14:58 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Wed, 13 Nov 2019 23:14:22 +1100 Message-Id: <20191113121422.20503-2-oohall@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191113121422.20503-1-oohall@gmail.com> References: <20191113121422.20503-1-oohall@gmail.com> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 2/2] tests: Squash __attrconst related warnings X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Currently we get a warning because in some of the test stub functions: [ HOSTCC ] hw/test/phys-map-test.c In file included from hw/test/phys-map-test.c:8: hw/test/../../core/test/stubs.c:78:1: warning: ‘const’ attribute on function returning ‘void’ [-Wattributes] 78 | { | ^ I'm pretty sure we added that __attrconst to squash a warning with an earlier GCC, then they went an added a warning for the "fix." I love compilers. Signed-off-by: Oliver O'Halloran --- core/test/stubs.c | 4 ++-- hdata/test/stubs.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/test/stubs.c b/core/test/stubs.c index 38e3d51793dd..2c2992796fb3 100644 --- a/core/test/stubs.c +++ b/core/test/stubs.c @@ -67,14 +67,14 @@ struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu, return NULL; } -void __attrconst cpu_wait_job(struct cpu_job *job, bool free_it) +void cpu_wait_job(struct cpu_job *job, bool free_it) { (void)job; (void)free_it; return; } -void __attrconst cpu_process_local_jobs(void) +void cpu_process_local_jobs(void) { } diff --git a/hdata/test/stubs.c b/hdata/test/stubs.c index 1d924b6c479e..107f94811670 100644 --- a/hdata/test/stubs.c +++ b/hdata/test/stubs.c @@ -105,8 +105,7 @@ struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu, } void cpu_wait_job(struct cpu_job *job, bool free_it); - -void __attrconst cpu_wait_job(struct cpu_job *job, bool free_it) +void cpu_wait_job(struct cpu_job *job, bool free_it) { (void)job; (void)free_it; @@ -114,8 +113,7 @@ void __attrconst cpu_wait_job(struct cpu_job *job, bool free_it) } void cpu_process_local_jobs(void); - -void __attrconst cpu_process_local_jobs(void) +void cpu_process_local_jobs(void) { }