Skip to content

[BUG] assert() gets redefined by standard assert.h #312

@borup3

Description

@borup3

Describe the bug
Zen C outputs a #define assert(cond, ...) to the C file but this easily gets redefined by included C libraries, like assert.h on macOS which is often included in other standard libraries or open-source projects.

To Reproduce
Steps to reproduce the behavior:

  1. Include https://github.com/septag/dmon/blob/master/dmon.h
  2. Build Zen C program with an assert call in it.
  3. See C errors.

Expected behavior
Zen C defines its own assert that doesn't clash with the standard assert and rewrites all assert() calls in Zen C to this, e.g. __zenc_assert().

Environment (please complete the following information):

  • OS: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions