Message ID | 20190625202713.10113-1-kieran.bingham@ideasonboard.com |
---|---|
State | Accepted |
Commit | caf25dc5cfd11b965316f02610d49ae3d886716b |
Headers | show |
Series |
|
Related | show |
Hi Kieran, Thank you for the patch. On Tue, Jun 25, 2019 at 09:27:13PM +0100, Kieran Bingham wrote: > 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. No they don't, they complain that for range loops are a C++11 feature, so it's not related. I would drop the second part of the sentence. > Reported-by: [autobuild.buildroot.net] Thomas Petazzoni <thomas.petazzoni@bootlin.com> > http://autobuild.buildroot.net/results/f6dd4c60c04892c8b1669e6000fce7edb2b6349e/ > > Fixes: 8356f8a6ab87 ("libcamera: Add a poll-based event dispatcher") > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > 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<struct pollfd> &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()); >
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<struct pollfd> &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());