Skip to content

EXIT_ERROR macro requires do-while() #9

Description

@not-kaz

Hi,

I believe the EXIT_ERROR/EXIT_RETURN macros should be wrapped in a do-while(0) loop.
At the moment the macro cannot be used in an if/else statement and the trailing semi-colon is unnecessary.

#define EXIT_ERROR(...) do { fprintf(stderr, VA_ARGS); exit(1) } while (0)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions