[clang] [clang][Sema] Add support for OpenBSD's syslog format attribute (PR #97366)

Brad Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 12 22:08:33 PDT 2024


brad0 wrote:

> Hmm, this function also seems to exist on Linux, though. Additionally, from my `man syslog` docs:

I'm not sure what you mean by that in relation to this addition of a format attribute.

> > The remaining arguments are a format, as in `printf(3)`, and any arguments required by the format, except that the two-character sequence `%m` will be replaced by the error message string `strerror(errno)`.
> 
> I also know next to nothing about BSD and how its `syslog()` works, but we should support that extra `%m` specifier (if we don’t already do that because it’s apparently also a glibc extension for `printf()`...). If the two of them differ, we might need two different format styles for BSD `syslog()` vs Linux `syslog()`.

Should be more or less the same as Linux and the X/Open specified functions.

The `%m` specifier is not a glibc extension from what I can find.


https://github.com/llvm/llvm-project/pull/97366


More information about the cfe-commits mailing list