From dd518180f1dc60144f35f9016208f8fa503dff3a Mon Sep 17 00:00:00 2001 From: Manuel Novoa III Date: Fri, 16 Aug 2002 18:35:07 +0000 Subject: Disable macro implementations. Somehow I missed the following from the ANSI/ISO C99 std... A library macro that masks a function declaration expands to an expression that evaluates each of its arguments once (and only once). ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Arguments that have side effects evaluate the same way whether the expression executes the macro expansion or calls the function. Macros for the functions getc and putc are explicit exceptions to this rule. Their stream arguments can be evaluated more than once. Avoid argument expressions that have side effects with these macros. This will be reworked before the next release. And yes, I feel stupid. --- include/ctype.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/ctype.h b/include/ctype.h index c39bd3ccd..844689c3f 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -83,7 +83,10 @@ extern int isxupper(int c) __THROW; /* uClibc-specific. */ /* Apparently, glibc implements things as macros if __NO_CTYPE isn't defined. * If we don't have locale support, we'll do the same. Otherwise, we'll * only use macros for the supported-locale-invariant cases. */ -#ifndef __NO_CTYPE +#if 0 +/* Currently broken, since masking macros, other than getc and putc, must + * evaluate their args exactly once. Will be fixed by the next release. mjn3 */ +/* #ifndef __NO_CTYPE */ #define isdigit(c) __isdigit(c) #define isxdigit(c) __isxdigit(c) -- cgit v1.2.3