[systemd-devel] compile with clang broken

David Herrmann dh.herrmann at gmail.com
Fri Aug 15 08:01:02 PDT 2014


Hi

On Fri, Jul 18, 2014 at 4:02 PM, Thomas H.P. Andersen <phomes at gmail.com> wrote:
> 1716f6dcf54d4c181c2e2558e3d5414f54c8d9ca (resolved: add LLMNR support
> for looking up names) broke the build on clang.
>
> src/resolve/resolved-manager.c:553:43: error: non-const static data
> member must be initialized out of line
> uint8_t buffer[CMSG_SPACE(MAX(sizeof(struct in_pktinfo), sizeof(struct
> in6_pktinfo)))
>
> Moving the MAX(...) to a separate line fixes that problem but another
> error then happens:
>
> src/resolve/resolved-manager.c:554:25: error: fields must have a
> constant size: 'variable length array in structure' extension will
> never be supported
> uint8_t buffer[CMSG_SPACE(size)
>
> We have encountered the same problem before and Lennart was able to
> write the code in a different way. Would this be possible here too?

I now pushed 3 commits which should fix this. Works fine with
LLVM+clang and GCC here.

Thanks
David


More information about the systemd-devel mailing list