From patchwork Tue Nov 1 13:07:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Erico Nunes X-Patchwork-Id: 689894 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3t7WkL5Q44z9t0q; Wed, 2 Nov 2016 00:08:10 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1c1YnQ-0001os-1y; Tue, 01 Nov 2016 13:08:08 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1c1YnK-0001oB-CL for fwts-devel@lists.ubuntu.com; Tue, 01 Nov 2016 13:08:02 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0BDBB31B339 for ; Tue, 1 Nov 2016 13:08:01 +0000 (UTC) Received: from ernunes.brq.redhat.com (dhcp-30-128.brq.redhat.com [10.34.30.128]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uA1D7xVY025828; Tue, 1 Nov 2016 09:08:00 -0400 From: Erico Nunes To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/3] fwts_framework.h: fix redefinition typedef warning Date: Tue, 1 Nov 2016 14:07:47 +0100 Message-Id: <1478005669-3752-1-git-send-email-ernunes@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 01 Nov 2016 13:08:01 +0000 (UTC) X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com When building the current fwts release with an older gcc 4.4, we get this redefinition typedef warning on struct fwts_framework, due to a forward typedef declaration which is made in the beginning of the file: In file included from ../../../src/lib/include/fwts_binpaths.h:27, from ../../../src/lib/include/fwts.h:54, from fwts_ac_adapter.c:19: ../../../src/lib/include/fwts_framework.h:158: error: redefinition of typedef ‘fwts_framework’ ../../../src/lib/include/fwts_framework.h:28: note: previous declaration of ‘fwts_framework’ was here By removing the second typedef in the definition, we can get rid of the warning and still build with every gcc version. As there are still supported systems with older gcc versions, such as RHEL6, it is interesting to have this fixed. This has been built and tested with gcc 6.2.1, gcc 4.8.5 and gcc 4.4.7. Signed-off-by: Erico Nunes Acked-by: Colin Ian King Acked-by: Alex Hung --- src/lib/include/fwts_framework.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/include/fwts_framework.h b/src/lib/include/fwts_framework.h index f7d5b69..ff01198 100644 --- a/src/lib/include/fwts_framework.h +++ b/src/lib/include/fwts_framework.h @@ -108,7 +108,7 @@ static inline void fwts_framework_summate_results(fwts_results *total, fwts_resu /* * Test framework context */ -typedef struct fwts_framework { +struct fwts_framework { uint32_t magic; /* identify struct magic */ fwts_log *results; /* log for test results */ char *results_logname; /* filename of results log */ @@ -155,7 +155,7 @@ typedef struct fwts_framework { fwts_pm_method pm_method; fwts_architecture host_arch; /* arch FWTS was built for */ fwts_architecture target_arch; /* arch being tested */ -} fwts_framework; +}; typedef struct { char *opt; /* option */