git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: clar unit testing framework FTBFS on uclibc systems (wchar_t unsupported)

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 17, 2024, 22:21 UTC
Message-ID
<ZxGN9zzt55GcL4Qj@tapette.crustytoothpaste.net>
In-Reply-To
<ZxEXFI80i4Q_4NJT@pks.im>
On 2024-10-17 at 13:54:28, Patrick Steinhardt wrote:
Show 31 quoted lines
> On Thu, Oct 17, 2024 at 03:33:51PM +0200, Patrick Steinhardt wrote:
> > On Thu, Oct 17, 2024 at 10:51:05AM +0700, Bagas Sanjaya wrote:
> > > Hi,
> > > 
> > > Since clar unit testing framework was imported by commit 9b7caa2809cb (t:
> > > import the clar unit testing framework, 2024-09-04), Git FTBFS on uclibc
> > > systems built by Buildroot:
> > 
> > Wait a second, that doesn't sound right to me. `wchar_t` is part of ISO
> > C90, so any system not supporting it would basically be unsupported by
> > us from my point of view. And indeed, uclibc _does_ support that type
> > alright. I guess the issue is rather that we're relying on some kind of
> > platform-specific behaviour and thus don't include the correct header.
> > 
> > I'll have a look, thanks for the report!
> 
> Okay, uclibc indeed has _optional_ support for `wchar_t`. But what
> really throws me off: "include/wchar.h" from uclibc has the following
> snippet right at the top:
> 
>     #ifndef __UCLIBC_HAS_WCHAR__
>     #error Attempted to include wchar.h when uClibc built without wide char support.
>     #endif
> 
> We unconditionally include <wchar.h>, and your system does not seem to
> have support for it built in. So why doesn't the `#error` trigger? It's
> also not like this is a recent error, it has been added with 581deed72
> (The obligatory forgotten files..., 2002-05-06).
> 
> We can do something like the below patch in clar, but I'd first like to
> understand why your platform seems to be broken in such a way.

Yeah, this is definitely broken. We require ISO C99, and according to the draft preceding the ratification[0], `wchar.h` and its contents are not optional. The similar draft for C11 also doesn't appear to make these optional.

I think users of uclibc will need to compile it with full ISO C99 support. I expect that a wide variety of other software will be similarly broken without that.

[0] Chosen because it is available for at no charge and the standard is not.
-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
Previous: Taylor BlauNext: Jeff King
Message 5 of 18 in “clar unit testing framework FTBFS on uclibc systems (wchar_t unsupported)”
  1. Bagas SanjayaOct 17, 2024
  2. Patrick SteinhardtOct 17, 2024
  3. Patrick SteinhardtOct 17, 2024
  4. Taylor BlauOct 17, 2024
  5. brian m. carlsonOct 17, 2024
  6. Jeff KingOct 18, 2024
  7. Patrick SteinhardtOct 18, 2024
  8. Jeff KingOct 18, 2024
  9. Patrick SteinhardtOct 18, 2024
  10. Taylor BlauOct 18, 2024
  11. Patrick SteinhardtOct 21, 2024
  12. Jeff KingOct 21, 2024
  13. Taylor BlauOct 21, 2024
  14. brian m. carlsonOct 18, 2024
  15. Jeff KingOct 21, 2024
  16. Jeff KingOct 21, 2024
  17. Bagas SanjayaOct 18, 2024
  18. Patrick SteinhardtOct 21, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.