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