Re: [PATCH v4l-utils v2] v4l-utils: include cstdlib for std::exit
Nick Desaulniers <[email protected]> Fri, 31 Jul 2026 12:40:03 -0700
| Newsgroups | org.kernel.vger.linux-media |
|---|---|
| Message-ID | <CAKwvOd=t6Hi5gdFPjoXBkC1c9DWFzDR3qp+Nw1xFmg8=G+5W0g@mail.gmail.com> |
Hi Hans and Mauro, can one of you pick this up, please? I probably should have cc'ed you explicitly. First time sending a patch to linux-media; don't recall now if `b4 prep --auto-to-cc` worked or not when I sent this. https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/ On Fri, Jul 24, 2026 at 3:35 PM Nick Desaulniers <[email protected]> wrote: > > libc++ recently trimmed their list of transitive includes. Include > <cstdlib> for the declaration of std::exit to avoid compile time errors > against newer versions of libc++. > > Fixes: > > v4l-utils/utils/v4l2-compliance/v4l2-test-input-output.cpp:53:11: > error: no member named 'exit' in namespace 'std'; did you mean simply > 'exit'? > 53 | return fail("couldn't get freq band\n"); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > v4l-utils/utils/v4l2-compliance/v4l2-compliance.h:286:3: note: > expanded from macro 'fail' > 286 | std::exit(EXIT_FAILURE); > | ^ ~~~~ > bionic/libc/include/stdlib.h:55:17: note: 'exit' declared here > 55 | __noreturn void exit(int __status); > | ^ > > Signed-off-by: Nick Desaulniers <[email protected]> > --- > Changes in v2: > - Also fixup v4l2-ctl.h; many .cpp files including it refer to > std::exit, not exit. > - Link to v1: https://lore.kernel.org/r/[email protected] > --- > utils/v4l2-compliance/v4l2-compliance.h | 1 + > utils/v4l2-ctl/v4l2-ctl.h | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h > index b43c5817..7ca4744e 100644 > --- a/utils/v4l2-compliance/v4l2-compliance.h > +++ b/utils/v4l2-compliance/v4l2-compliance.h > @@ -25,6 +25,7 @@ > #include <set> > #include <string> > #include <cstdint> > +#include <cstdlib> > > #include <linux/videodev2.h> > #include <linux/v4l2-subdev.h> > diff --git a/utils/v4l2-ctl/v4l2-ctl.h b/utils/v4l2-ctl/v4l2-ctl.h > index ae6f43f3..483b2c36 100644 > --- a/utils/v4l2-ctl/v4l2-ctl.h > +++ b/utils/v4l2-ctl/v4l2-ctl.h > @@ -2,9 +2,9 @@ > #define _V4L2_CTL_H > > #include <cstdint> > +#include <cstdlib> > #include <linux/videodev2.h> > #include <linux/v4l2-subdev.h> > -#include <stdlib.h> > #include <v4l-getsubopt.h> > > #include <v4l2-info.h> > > --- > base-commit: b32589c514810daacc05a2015d205b997cd11970 > change-id: 20260717-libcpp_transitive-0c6a9e39e5f9 > > Best regards, > -- > Nick Desaulniers <[email protected]> > -- Thanks, ~Nick Desaulniers