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

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 15 09:21:59 PDT 2024


Sirraide 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.

I think my question was mainly as to why `syslog` is treated as an OpenBSD feature (at least in `getFormatAttrKind`) if it’s not exclusive to OpenBSD, because Linux also seems to have it.

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

According to `man 3 printf` on my system:
![image](https://github.com/user-attachments/assets/aaa45c86-b7f7-46f6-a09c-4095f632d45a)

Additionally:
https://github.com/llvm/llvm-project/blob/106621b601d7dc7c4929fba293f7e5ffe6b92c58/clang/lib/AST/PrintfFormatString.cpp#L346-L347

So it does seem like we already support this. In that case, amending the comment to include that it’s also used by `syslog()` (on both BSD and Linux) would be nice.

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


More information about the cfe-commits mailing list