Skip to content

Commit bbcddab

Browse files
committed
Fix user_inc() and user_dec() getting merged into one function in release builds (issue #627)
1 parent 101205e commit bbcddab

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/compiler/sc3.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ static void (*op1[17])(void) = {
8080
os_le,os_ge,os_lt,os_gt, /* hier9, index 11 */
8181
ob_eq,ob_ne, /* hier10, index 15 */
8282
};
83-
/* These two functions are defined because the functions inc() and dec() in
84-
* SC4.C have a different prototype than the other code generation functions.
83+
/* These two macros are defined because the functions inc() and dec() in SC4.C
84+
* have a different prototype than the other code generation functions.
8585
* The arrays for user-defined functions use the function pointers for
8686
* identifying what kind of operation is requested; these functions must all
8787
* have the same prototype. As inc() and dec() are special cases already, it
88-
* is simplest to add two "do-nothing" functions.
88+
* is simplest to cast them into "void (*)(void)".
8989
*/
90-
static void user_inc(void) {}
91-
static void user_dec(void) {}
90+
#define user_inc ((void (*)(void))inc)
91+
#define user_dec ((void (*)(void))dec)
9292

9393
/*
9494
* Searches for a binary operator a list of operators. The list is stored in

0 commit comments

Comments
 (0)