[libc-commits] [PATCH] D134074: [libc] add strerror

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Sep 16 15:32:56 PDT 2022


sivachandra added inline comments.


================
Comment at: libc/src/__support/error_to_string.h:1
+//===-- Definition of a class for mapping errors to strings -----*- C++ -*-===//
+//
----------------
Almost everything in this file should live in a `.cpp` file. The only thing declared in the .h file should something like:

```
cpp::string_view error_to_string(int error);
```

IMO, that single function should take care of unknown error numbers also. Do you have a use case where `max_buff_size` and `get_unknown_str` are required?

A more fundamental question - is there any reason why this should live in `__support` at all?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134074/new/

https://reviews.llvm.org/D134074



More information about the libc-commits mailing list