]> git.ozlabs.org Git - ccan/blobdiff - ccan/tcon/tcon.h
tcon: fix warning when it's used with NULL on some gcc versions.
[ccan] / ccan / tcon / tcon.h
index e0f84b383976c4d106e6d9fe3ee9043c449d1ed8..df3aac88b785a4acc241e125a9c377766a55272d 100644 (file)
  * It evaluates to @x so you can chain it.
  */
 #define tcon_check_ptr(x, canary, expr)                                \
-       (sizeof(&(x)->_tcon[0].canary == (expr)) ? (x) : (x))
-
+       (sizeof((expr) ? (expr) : &(x)->_tcon[0].canary) ? (x) : (x))
 
 /**
  * tcon_type - the type within a container (or void *)