From patchwork Tue Jun 25 20:27:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 1521 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E41E060BC7 for ; Tue, 25 Jun 2019 22:27:17 +0200 (CEST) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4696F510; Tue, 25 Jun 2019 22:27:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1561494437; bh=3pm3qp+3KxledXfjkUzIDAue1Z05DSjBStXh9QxpKYo=; h=From:To:Cc:Subject:Date:From; b=sV0Ypvfe7gDFMQ4BhPQvpONuNhQlfKe2ciTB4s3Zl04ZnwrtrLdwr4oiyYlcEOht6 phNuh0yk/01jyynSRoRDIwBP8LN3EaD8LFQUPAYgE61nuq7YuhVufDz+zrOCQWkriR sqC92kKNrz5NkuS3GE1/hwFjqT3p26QAZfNUGf2A= From: Kieran Bingham To: LibCamera Devel Cc: Kieran Bingham , "[autobuild.buildroot.net] Thomas Petazzoni" , Laurent Pinchart Date: Tue, 25 Jun 2019 21:27:13 +0100 Message-Id: <20190625202713.10113-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] libcamera: event_dispatcher_poll: Remove struct keyword from for-range X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 20:27:18 -0000 When using -std=c++11, GCC versions 6.2 and 6.3 take objection to declaring a struct type when using a range based iterator: event_dispatcher_poll.cpp:231:13: error: types may not be defined in a for-range-declaration [-Werror] for (const struct pollfd &pfd : pollfds) { ^~~~~~ cc1plus: all warnings being treated as errors Removing the keyword 'struct' ensures that the compiler does not try to declare the type, and instead uses the type as already defined by the relevant poll.h header. This issue does not affect later compiler versions, though earlier versions do complain about this keyword if the -std=c++11 option is not given. Reported-by: [autobuild.buildroot.net] Thomas Petazzoni http://autobuild.buildroot.net/results/f6dd4c60c04892c8b1669e6000fce7edb2b6349e/ Fixes: 8356f8a6ab87 ("libcamera: Add a poll-based event dispatcher") Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- src/libcamera/event_dispatcher_poll.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/event_dispatcher_poll.cpp b/src/libcamera/event_dispatcher_poll.cpp index 0ff99fce47ab..df9dffb2326c 100644 --- a/src/libcamera/event_dispatcher_poll.cpp +++ b/src/libcamera/event_dispatcher_poll.cpp @@ -241,7 +241,7 @@ void EventDispatcherPoll::processNotifiers(const std::vector &pol { EventNotifier::Exception, POLLPRI }, }; - for (const struct pollfd &pfd : pollfds) { + for (const pollfd &pfd : pollfds) { auto iter = notifiers_.find(pfd.fd); ASSERT(iter != notifiers_.end());