All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: linux-media@vger.kernel.org, Yi Kong <yikong@google.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Subject: [PATCH v4l-utils v2] v4l-utils: include cstdlib for std::exit
Date: Fri, 24 Jul 2026 15:35:40 -0700	[thread overview]
Message-ID: <20260724-libcpp_transitive-v2-1-87a2d11905b6@google.com> (raw)

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 <ndesaulniers@google.com>
---
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/20260717-libcpp_transitive-v1-1-3af91860affe@google.com
---
 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 <ndesaulniers@google.com>


                 reply	other threads:[~2026-07-24 22:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260724-libcpp_transitive-v2-1-87a2d11905b6@google.com \
    --to=ndesaulniers@google.com \
    --cc=linux-media@vger.kernel.org \
    --cc=yikong@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.