dhess / c-ringbuf

A ring buffer implemented in C
Other
418 stars 143 forks source link

Add removal of asserts via preprocessor facilities #1

Closed assp1r1n3 closed 8 years ago

dhess commented 8 years ago

Thanks. I have two comments:

  1. You've mixed the assert() changes with the README changes. You should make these separate pull requests.
  2. The macros around assert() are unnecessary. You can simply add -DNDEBUG to the Makefile and the assert()s will be compiled out.

This project is intended more to be used as part of a larger project, which is why it's in the public domain; and as such, the most important thing is that it can be demonstrated to work 100% correctly without bugs, which is why the assert()s are enabled by default. If you're comfortable with the code and you want to use it without the assert()s, you should just copy it into your project and make whatever changes you want there.

That said, I would accept either of these (separate) patches as long as the -DNDEBUG Makefile patch is commented out by default.