HomeFreeBSD

net/latd: Fix build with Clang 6

Description

net/latd: Fix build with Clang 6

llogin.cc:233:25: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]

char verboseflag[1] = {verbose};
                       ^~~~~~~

http://beefy11.nyi.freebsd.org/data/head-i386-default/p477696_s338122/logs/latd-1.31.log

interfaces-bpf.cc:68:38: error: non-constant-expression cannot be narrowed from type 'long' to 'bpf_u_int32' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]

BPF_STMT(BPF_LD + BPF_H + BPF_ABS, LATD_OFFSETOF(struct ether_header, ether_type)),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

interfaces-bpf.cc:62:29: note: expanded from macro 'LATD_OFFSETOF'
#define LATD_OFFSETOF(t, m) (((char *) &(((t *) NULL)-> m)) - ((char *) ((t *) NULL)))

^

Details

Provenance
tobikAuthored on
Parents
rP478121: textproc/htdig: Fix build with Clang 6
Branches
Unknown
Tags
Unknown