Skip to content

Assorted development notes

magnum edited this page Sep 26, 2023 · 3 revisions
/* Crackpot[tm] debug hack for valid() by magnum */
#define goto if(fprintf(stderr,"%s fail line %d at token '%s', rest '%s'\n",__FUNCTION__,__LINE__,ptr,ctcopy))goto

This assumes the "fails" are using eg. goto error;, but this can obviously be modified to work with return 0; as well:

#define return if(fprintf(stderr,"%s fail at %s:%d\n",__FUNCTION__,__FILE__,__LINE__))return

Note to self: Do not forget to #undef goto and/or #undef return after the function / before any return 1; 🤣