On Mon, Aug 26, 2019, 8:02 PM Hal Murray via devel <devel@ntpsec.org> wrote:
> > How do I tell waf to fail on warnings? > > I'm trying to use this to detect which API I'm getting. > > STRERROR_FRAG = """ > #include <string.h> > int main(void) { > char buf [100]; > const char *foo = strerror_r(6, buf, sizeof(buf)); > return foo == NULL; > } > """ > > ctx.check_cc( > fragment=STRERROR_FRAG, > define_name="STRERROR_CHAR", > features="c", > msg="Checking if strerror_r returns char*", > mandatory=False, > comment="Whether strerror_r returns char*" > ) > > Unfortunately, it gives a warning rather than an error so it looks like it > works. > ../../test.c:5:21: warning: initialization makes pointer from integer > without a c > ast [-Wint-conversion] > const char *foo = strerror_r(6, buf, sizeof(buf)); > > How to I tell waf to fail on warnings? > Plan B would be to run the test code and see if the answer is NULL. > A relatively quick search suggests mandatory=True as an argument. >
_______________________________________________ devel mailing list devel@ntpsec.org http://lists.ntpsec.org/mailman/listinfo/devel