Skip to content

compilation error when stdnoreturn.h is included #563

@bernhardbreuss

Description

@bernhardbreuss

Hi,

when stdnoreturn.h is included before unity.h a compiler error for a unknown attribute is generated:

In file included from ../../src/unity.h:21,
                 from ../tests/test_unity_strings.c:7:
../../src/unity_internals.h:621:1: error: '_Noreturn' attribute directive ignored [-Werror=attributes]
  621 | void UnityFail(const char* message, const UNITY_LINE_TYPE line) UNITY_FUNCTION_ATTR(noreturn);
      | ^~~~
../../src/unity_internals.h:622:1: error: '_Noreturn' attribute directive ignored [-Werror=attributes]
  622 | void UnityIgnore(const char* message, const UNITY_LINE_TYPE line) UNITY_FUNCTION_ATTR(noreturn);
      | ^~~~

This seems to occur because in stdnoreturn.h noreturn is defined to the keyword _Noreturn.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions