]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: fix build failure on armhf
authorMatthieu Longo <matthieu.longo@arm.com>
Thu, 12 Mar 2026 10:18:59 +0000 (10:18 +0000)
committerMatthieu Longo <matthieu.longo@arm.com>
Thu, 12 Mar 2026 10:34:42 +0000 (10:34 +0000)
armhf build fails because the implicit conversion operator from
rgb_color to `uint8_t *' introduces an ambiguity.

In ./gdb/tui/tui-io.c, expressions such as:

  init_color (next, rgb[0] * 1000 / 255, rgb[1] * 1000 / 255, ...

become ambiguous between:

  constexpr uint8_t& rgb_color::operator[](std::size_t)’
  operator[](uint8_t* {aka unsigned char*}, int) (built-in)

leading to a build error:

  error: ISO C++ says that these are ambiguous

Fix the issue by removing the unused implicit conversion operator.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
Approved-By: Tom Tromey <tom@tromey.com>
gdb/ui-style.h

index a1d656cd39cfd4e59c23535ba2f6e7ddbaa2ba22..fc40b93709d979ad25835f180fab41e8bb1603ec 100644 (file)
@@ -72,7 +72,6 @@ public:
   constexpr uint8_t g () const noexcept { return m_data[1]; }
   constexpr uint8_t b () const noexcept { return m_data[2]; }
 
-  constexpr operator uint8_t *() noexcept { return m_data.data (); }
   constexpr size_t size () const noexcept { return m_data.size (); }
 
   constexpr uint8_t &operator[] (std::size_t idx) noexcept