Skip to content

EXIT_ERROR macro requires do-while() #9

@not-kaz

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)

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