Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. /* The first occurrence of EXPR is not evaluated due to the sizeof,
  2. but will trigger any pedantic warnings masked by the __extension__
  3. for the second occurrence. The ternary operator is required to
  4. support function pointers and bit fields in this context, and to
  5. suppress the evaluation of variable length arrays. */
  6. # define assert(expr)
  7. ((void) sizeof ((expr) ? 1 : 0), __extension__ ({
  8. if (expr)
  9. ; /* empty */
  10. else
  11. __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION);
  12. }))
  13.  
  14. # define assert(expr)
  15. ({
  16. if (expr)
  17. ; /* empty */
  18. else
  19. __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION);
  20. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement