[Git][NTPsec/ntpsec][master] Config: Fix error when miscasting pointer ...

Richard Laager gitlab at mg.gitlab.com
Thu Feb 20 23:46:32 UTC 2020



Richard Laager pushed to branch master at NTPsec / ntpsec


Commits:
47b571e1 by James Browning at 2020-02-20T23:29:21+00:00
Config: Fix error when miscasting pointer ...

There is a warning:
'cast from pointer to integer of different size [-Wpointer-to-int-cast]'
which breaks ./waf config when it reaches the function check for
CMAC_CTX_new if CFLAGS= "-Werror" is prepended. This seems to solve it.

Single casting as (long) is unacceptable.

Returning 'p ? 1 : 0' or '!!p' breaks the macOS runners;
they detecct res_init() which is not a good thing.

Thus the double cast (int)(long)

- - - - -


1 changed file:

- wafhelpers/probes.py


Changes:

=====================================
wafhelpers/probes.py
=====================================
@@ -30,7 +30,7 @@ def probe_function(ctx, function, prerequisites, mandatory=False, use=None):
         src += "#include <%s>\n" % hdr
     src += """int main(void) {
         void *p = (void*)(%s);
-        return (int)p;
+        return (int)(long)p;
 }
 """ % function
     have_name = "HAVE_%s" % function.upper()



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/47b571e10fb9cd112ee7b1b6fdcb65fa8ae03a7e

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/47b571e10fb9cd112ee7b1b6fdcb65fa8ae03a7e
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20200220/311d1144/attachment.htm>


More information about the vc mailing list