Skip to content

Avoid warning about undefined PRINTF_INCLUDE_CONFIG_H in printf.h #212

@eyalroz

Description

@eyalroz

If we don't define PRINTF_INCLUDE_CONFIG_H, we may get the warning:

In file included from /home/eyalroz/src/mine/printf/test/aliasing.c:2:
/home/eyalroz/src/mine/printf/src/printf/printf.h:42:5: warning: "PRINTF_INCLUDE_CONFIG_H" is not defined, evaluates to 0 [-Wundef]
   42 | #if PRINTF_INCLUDE_CONFIG_H
      |     ^~~~~~~~~~~~~~~~~~~~~~~

That warning is... arguably invalid, because it's well-defined in the standard that undefined -> evaluates to 0, but - it is what it is.

So, let's replace this check with:

#if defined(PRINTF_INCLUDE_CONFIG_H) && PRINTF_INCLUDE_CONFIG_H

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolved-on-developA changeset fixing this issue has been commiutted to the development branchtask

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions