scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 8351c2b171d0d9f0a1746c42254d86160ab15ff1
parent a90a056decd43416af84311bc5577fa99cd6c217
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat, 24 Aug 2019 11:25:11 +0100

Change debug to sccdebug

Debug is a too good name to be used in a global variable
used in every program.

Diffstat:
Minclude/scc/scc/scc.h | 4++--
Msrc/cmd/scc/cc1/fold.c | 2+-
Msrc/libscc/debug.c | 4++--
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/scc/scc/scc.h b/include/scc/scc/scc.h @@ -1,10 +1,10 @@ #include <stddef.h> -extern int debug; +extern int enadebug; #ifndef NDEBUG #define DBG(...) dbg(__VA_ARGS__) -#define DBGON() (debug = 1) +#define DBGON() (enadebug = 1) #else #define DBG(...) #define DBGON() diff --git a/src/cmd/scc/cc1/fold.c b/src/cmd/scc/cc1/fold.c @@ -637,7 +637,7 @@ simplify(Node *np) if (!np) return NULL; - if (debug) + if (enadebug) prtree(np); l = np->left = simplify(np->left); diff --git a/src/libscc/debug.c b/src/libscc/debug.c @@ -3,12 +3,12 @@ #include <scc/scc.h> -int debug; +int enadebug; void dbg(const char *fmt, ...) { - if (!debug) + if (!enadebug) return; va_list va; va_start(va, fmt);