Skip to content
  • Alessandro Rubini's avatar
    assert.h: parameter passing fix · c04fb597
    Alessandro Rubini authored and Adam Wujek's avatar Adam Wujek committed
    See gcc info pages: "Macros with a Variable Number of Arguments."
    The ISO-C stadanrd doesn't allow varargs macros to get zero or more
    arguments. So this fixes the problem using the gcc extension.
    A standard-compliant alternative would be to have "fmt" included in
    the variadic part, like this:
      #define assert(cond, ...) \
            if (CONFIG_HAS_ASSERT && !(cond)) \
                    __assert(__func__, __LINE__, 1 /* forever */, __VA_ARGS__)
    But the reader wouldn't  now it's a fmt+args.
    Signed-off-by: default avatarAlessandro Rubini <>