Conversation
This should stop a lot of warning spam on any clang install, not just macOS/FreeBSD Signed-off-by: John Studnicka <contact@zentec.dev>
This should make the busfault structs happy on both sides of the ifdef Signed-off-by: John Studnicka <contact@zentec.dev>
|
@b-aaz @cepelinas9000 ping |
|
|
||
| #ifndef _X_ATTRIBUTE_VPRINTF | ||
| # if defined(__GNUC__) && (__GNUC__ >= 2) && (!defined(__APPLE__)) && (!defined(__FreeBSD__)) | ||
| # if defined(__GNUC__) && (__GNUC__ >= 2) && !defined(__clang__) |
There was a problem hiding this comment.
Don't we need to keep the apple and bsd checks here?
Does clang not support printf-like attributes?
There was a problem hiding this comment.
In the else branch, this directive defines _X_ATTRIBUTE_VPRINTF to be the same as the _X_ATTRIBUTE_PRINTF macro which uses generic __printf__ format attribute instead of gnu_printf.
Right now, the attribute type checking does not work at all on Linux clang because it's just throwing up a bunch of warnings saying "I don't know what gnu_printf means." I tried to find if gnu_printf has some special behavior on GCC, but it looks like it does the same thing as regular printf anyways.
If we wanted to do a future cleanup on this, I would probably delete _X_ATTRIBUTE_VPRINTF altogether.
See here: https://github.com/X11Libre/mirror.fdo.xorgproto/blob/master/include/X11/Xfuncproto.h#L164
There was a problem hiding this comment.
Also, there is a GCC port for FreeBSD, so this logic which gates gnu_printf behind the OS is wrong. I think it needs to check the compiler directly instead of guessing from the OS.
|
Is there anything I can do to keep this moving forward? |
|
LGTM, but I want to get one of the bsd users' thoughts on this. |
|
It looks LGTM for me too, just I'm causal FreeBSD user (compiled in FreeBSD xserver and didn't throw errors) |
|
I wonder if we could do away with |
This is a small step towards #1979 to get a musl sysroot building with clang. I tested the build works with
xfbdevenabled too.