On Thu, Dec 17, 2009 at 01:10:29AM +0100, Vincent Torri wrote: > On Wed, Dec 16, 2009 at 9:34 PM, Fedor Sergeev <Fedor.Sergeev at > sun.com>wrote: > > > > > > The problem, here, is that the preprocessor is adding space before and > > after > > > the dot: > > > > > > image . image > > > > > > which is actually *very* annoying for us (at least on opensolaris :-) ). > > > > > > My questions are: > > > > > > 1) is that behavior normal ? > > > > Yep. > > Preprocessor is designed to preprocess C code. > > It is not meant as a general purpose text processor. > > > > so it would not work for a macro that would access to the member of a struct > ?
Depends on your definition of "would not work"? C preprocessor works for all kinds of C code. Whitespaces between the tokens are insignificant from a C compiler point of view, so (for struct <s> and member <m>) s.m or s . m are both fine for C compiler. > > > 2) if not, is there a way to make the preprocessor not adding those > > spaces > > > > See suggestions from Peter Damron. > > > > 'cpp' might do the job for you. > > > > Indeed, cpp is doing the trick. Though, there are still c++ comments. I > remove them by passing cc -E but i have seen that cpp accepts -std or -x c++ > as options in the man pages. I tried them, but they are not working (the > error is 'unknown flag'). Is it normal that they are not recognized ? Looks like you are reading man page for gcc'ish cpp. regards, Fedor.
