
Show HN: A set of dbg() macros for C - eerimoq
https://github.com/eerimoq/dbg-macro
======
s_gourichon
I wrote and use regularly similar macros for C, oriented towards minimal
context.

They are less advanced on some areas, but more advanced on some.

For example, they do not depend on C11 generic feature, which is an advantage
on the many non-C11 platforms (like 8-bit-targeting compiler SDCC).

On the strong side:

* log any expression: `somemacro(foo.bar())` will log `foo.bar() = 42` * compile-time global enable/disable * compile-time debug level threshold

I've been planning to share that for a moment.

Some working parts are used on [https://github.com/cpcitor/color-flood-for-
amstrad-cpc/blob/...](https://github.com/cpcitor/color-flood-for-amstrad-
cpc/blob/master/log.h)

It will eventually appear on [https://github.com/fidergo-stephane-
gourichon?tab=repositori...](https://github.com/fidergo-stephane-
gourichon?tab=repositories)

I also wrote similar macros for C++ mentioned on
[https://news.ycombinator.com/item?id=21071367](https://news.ycombinator.com/item?id=21071367)

