This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Re: Preprocessor woes


On Fri, Jan 05, 2001 at 10:33:55PM +0100, Mark Kettenis wrote:
> The line numbers are exactly the lines where constructs like
> 
>    #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
> 
> occur.  Since the SHLIB_COMPAT macro uses the ISO C ## concatenation
> operator, -traditional messes things up.  Is there any chance at
> convincing the GCC folks to provide a preprocessor that's backwards
> compatible with cccp?

Isn't it better to replace -traditional with -x assembler-with-cpp ?
(I've suggested it already once).
Like that there won't be any problems with ## vs. /**/ and cpp won't insert
spaces where it should not (tested with gcc-2.95.2, RH 2.96, CVS 2.97):

2001-01-05  Jakub Jelinek  <jakub@redhat.com>

	* Makeconfig (preprocess-version): Replace -traditional with
	-x assembler-with-cpp.

--- libc/Makeconfig.jj	Tue Jan  2 14:17:25 2001
+++ libc/Makeconfig	Fri Jan  5 23:17:59 2001
@@ -702,9 +702,9 @@ ifeq (yes, $(build-shared))
 # %ifdef et al based on config.h settings or other %include'd files.
 define preprocess-versions
 sed '/^[ 	]*#/d;s/^[ 	]*%/#/' \
-| $(CC) -traditional -E -undef -I$(common-objdir) -I$(..)include \
+| $(CC) -E -undef -I$(common-objdir) -I$(..)include \
 		  -include $(common-objpfx)config.h \
-		  -x c - \
+		  -x assembler-with-cpp - \
 | sed '/^[ 	]*#/d;/^[ 	]*$$/d'
 endef
 
	Jakub

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]