From: Martin Str|mberg Message-Id: <200004252052.WAA08038@father.ludd.luth.se> Subject: Re: restrict In-Reply-To: from Eli Zaretskii at "Apr 24, 2000 08:44:59 am" To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii) Date: Tue, 25 Apr 2000 22:52:43 +0200 (MET DST) Cc: djgpp-workers AT delorie DOT com (DJGPP-WORKERS) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk According to Eli Zaretskii: > I suggest the following: > > #if __STDC_VERSION__ >= 199901 > #elif __GNUC__ >= 2 && __GNUC_MINOR__ >= 91 > #define restrict __restrict__ > #else > #define restrict > #endif It doesn't seem to work. #include added to stdio.h. ----- include/libc/features.h starts. ----- /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */ #ifndef __dj_include_libc_features_h__ #define __dj_include_libc_features_h__ #ifdef __cplusplus extern "C" { #endif #if __STDC_VERSION__ >= 199901 #define STDC_VERSION_IS_BIGGER_THAN_199901 1 #elif __GNUC__ >= 2 && __GNUC_MINOR__ >= 91 #define restrict __restrict__ #else #define restrict #endif #ifdef __cplusplus } #endif #endif /* __dj_include_libc_features_h__ */ ----- include/libc/features.h ends. ----- ----- Output from making in src/libc/ansi/assert/assert.c with -E starts. ----- gcc ... -c assert.c # 1 "assert.c" # 1 "../../../../include/assert.h" 1 void __dj_assert(const char *,const char *,int) __attribute__((__noreturn__)) ; # 2 "assert.c" 2 # 1 "../../../../include/stdio.h" 1 # 1 "../../../../include/libc/features.h" 1 # 7 "../../../../include/stdio.h" 2 # 1 "../../../../include/sys/version.h" 1 # 14 "../../../../include/stdio.h" 2 etc... ----- Output from making in src/libc/ansi/assert/assert.c with -E ends. ----- So for some reason it skips the defines although "gcc --version" reports "2.952" and compiling with "-v" reports "-D__GNUC__=2 -DGNUC_MINOR__=95". Am I missing something? Right, MartinS