discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT: ^L in source (was Re: wrong line endings in a gnustep file)


From: Pascal Bourguignon
Subject: Re: OT: ^L in source (was Re: wrong line endings in a gnustep file)
Date: Sat, 23 Aug 2003 23:48:55 +0200

Peter Cooper writes:
> On Sat, Aug 23, 2003 at 11:52:40AM -0400, Andrew Pinski wrote:
> > >Only somewhat relatedly, I've been wondering about some source code 
> > >I've seen
> > >that has ^L (i.e. ctrl-L, ASCII 12) in it. I've seen it in some of the
> > >GNUstep sources but also some other projects' code. What does it do in 
> > >a C
> > >source file? Does the compiler (or preprocessor) just ignore it?
> > 
> > ^L is the marker for a new page so this is white space and is ignored 
> > correctly by GCC.
> 
> But things like escape (^[) don't get ignored. I've noticed my bad 
> habit from vi causes "invisible escapes" to be embedded within files
> I'm editing in ProjectCenter. And consequent compile-phase failures.
> 
> I haven't checked a recent version of CodeEditor. Is its behaviour
> better (if only showing "box" glyphs or something)?

With ProjectBuilder, it was possible to specify filters on source file
before  compilation.   Or  was  it  the compiler  driver  who  did  it
automatically?   Anyway, it  was  able to  compile  .c.rtf and  .m.rtf
files.

Note  that it  should  be simple  enough  to add  a  Makefile rule  to
preprocess your sources before compilation:

all:preprocess compile
preprocess:
    for f in $(SOURCES) ; do mv $f $f~ && tr -d '\033' <$f~ >$f ; done


-- 
__Pascal_Bourguignon__                   http://www.informatimago.com/
----------------------------------------------------------------------
Do not adjust your mind, there is a fault in reality.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]