* Preprocessor woes
@ 2001-01-05 13:34 Mark Kettenis
2001-01-05 13:46 ` Neil Booth
0 siblings, 1 reply; 6+ messages in thread
From: Mark Kettenis @ 2001-01-05 13:34 UTC (permalink / raw)
To: libc-hacker; +Cc: gcc
When compiling glibc for the Hurd, during generation of the .map
files, I get the following error messages:
:1163: parse error
:1169: parse error
:1258: parse error
:1267: parse error
:1295: parse error
:1303: parse error
:1342: parse error
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?
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Preprocessor woes
2001-01-05 13:34 Preprocessor woes Mark Kettenis
@ 2001-01-05 13:46 ` Neil Booth
2001-01-05 14:41 ` Zack Weinberg
0 siblings, 1 reply; 6+ messages in thread
From: Neil Booth @ 2001-01-05 13:46 UTC (permalink / raw)
To: Mark Kettenis; +Cc: libc-hacker, gcc
Mark Kettenis wrote:-
> 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?
Try using the portable CONCAT macros that GCC does. That's much
simpler than rewriting tradcpp (which is what this would require).
Neil.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Preprocessor woes
2001-01-05 13:46 ` Neil Booth
@ 2001-01-05 14:41 ` Zack Weinberg
2001-01-05 15:39 ` Mark Kettenis
0 siblings, 1 reply; 6+ messages in thread
From: Zack Weinberg @ 2001-01-05 14:41 UTC (permalink / raw)
To: Neil Booth; +Cc: Mark Kettenis, libc-hacker, gcc
On Fri, Jan 05, 2001 at 09:45:55PM +0000, Neil Booth wrote:
> Mark Kettenis wrote:-
>
> > 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?
>
> Try using the portable CONCAT macros that GCC does. That's much
> simpler than rewriting tradcpp (which is what this would require).
Concatenation with ## has never worked in -traditional mode. The real
problem is something else.
zw
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Preprocessor woes
2001-01-05 14:41 ` Zack Weinberg
@ 2001-01-05 15:39 ` Mark Kettenis
2001-01-05 16:11 ` Richard Henderson
2001-01-05 16:56 ` Joe Buck
0 siblings, 2 replies; 6+ messages in thread
From: Mark Kettenis @ 2001-01-05 15:39 UTC (permalink / raw)
To: zackw; +Cc: neil, libc-hacker, gcc
From: "Zack Weinberg" <zackw@stanford.edu>
Date: Fri, 5 Jan 2001 14:40:26 -0800
On Fri, Jan 05, 2001 at 09:45:55PM +0000, Neil Booth wrote:
> Mark Kettenis wrote:-
>
> > 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?
>
> Try using the portable CONCAT macros that GCC does. That's much
> simpler than rewriting tradcpp (which is what this would require).
Concatenation with ## has never worked in -traditional mode. The real
problem is something else.
We used to preprocess this stuff without -traditional. Then the new
preprocessor introduced some whitespace in funny places; see
< http://sources.redhat.com/ml/libc-alpha/2000-11/msg00262.html >. Then
Ulrich switched to -traditional (I think after a suggestion from you
or Neil). And now the Hurd doesn't build anymore :-(.
I cc'd you GCC folks to make you aware that the new preprocessor is
causing some real pain, and I saw no way out. Fortunately there are
at least two workarounds (thanks Neil and Jakub). I still think it
would be better if the new integrated preprocessor would be backwards
compatible with the old one, even for sources that are not C.
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Preprocessor woes
2001-01-05 15:39 ` Mark Kettenis
@ 2001-01-05 16:11 ` Richard Henderson
2001-01-05 16:56 ` Joe Buck
1 sibling, 0 replies; 6+ messages in thread
From: Richard Henderson @ 2001-01-05 16:11 UTC (permalink / raw)
To: Mark Kettenis; +Cc: zackw, neil, libc-hacker, gcc
On Sat, Jan 06, 2001 at 12:39:02AM +0100, Mark Kettenis wrote:
> I still think it would be better if the new integrated preprocessor
> would be backwards compatible with the old one, even for sources that
> are not C.
Try -xassembler-with-cpp. I believe many of the whitespace
issues go away then.
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Preprocessor woes
2001-01-05 15:39 ` Mark Kettenis
2001-01-05 16:11 ` Richard Henderson
@ 2001-01-05 16:56 ` Joe Buck
1 sibling, 0 replies; 6+ messages in thread
From: Joe Buck @ 2001-01-05 16:56 UTC (permalink / raw)
To: Mark Kettenis; +Cc: zackw, neil, libc-hacker, gcc
> I cc'd you GCC folks to make you aware that the new preprocessor is
> causing some real pain, and I saw no way out. Fortunately there are
> at least two workarounds (thanks Neil and Jakub). I still think it
> would be better if the new integrated preprocessor would be backwards
> compatible with the old one, even for sources that are not C.
The integrated preprocessor is intended for use only with C, C++ or
Objective-C, because in its normal mode the lexing for the preprocessor
and the compiler are combined. There are no longer two separate programs
communicating with each other via file or pipe. (If you ask for the
output, you do get text, but it is somewhat artificial in that the
compiler never normally reads this text).
I've supported efforts to keep -traditional traditional (that is, suitable
for all the non-C uses it's currently being put to), including beating
Zack up perhaps a bit too strongly when he objected. But I'll only take
that battle so far. If you want to process text that is not C (or C++ or
Objective-C), use -traditional; without -traditional there is no promise
of consistent behavior for input that is not ISO C. Demanding complete
consistency on non-standard input is an impossibly difficult task for a
completely new implementation.
We'll be happy to help people who are having problems with this fix their
software or come up with other workarounds.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2001-01-05 16:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-05 13:34 Preprocessor woes Mark Kettenis
2001-01-05 13:46 ` Neil Booth
2001-01-05 14:41 ` Zack Weinberg
2001-01-05 15:39 ` Mark Kettenis
2001-01-05 16:11 ` Richard Henderson
2001-01-05 16:56 ` Joe Buck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).