compiling DOS file w/gcc
Rolf Fiedler (rfie@majestix.ferrari.de)
Thu, 15 Oct 1998 08:31:49 +0200
On Wed, 14 Oct 1998, Kevin Dahlhausen wrote:
>
> > Does anyone know if it's possible to compile a DOS-style file with gcc without
> > first converting the file to Unix format? I would like to make things as easy
> > as possible for our windows users so I don't want to require them to run dos2unix
> > before they compile. Our compiler is running on a linux system and the Win95
> > people are accessing their home directories through Samba. However, the files
> > are in DOS format since we're using SourceSafe for Win95/NT as the source code
> > management tool.
>
> Yes, I just cross compiled a dos file w/gcc 2.8.1 under linux.
> It worked w/egcs also.
The problem we encountered here is not the c-compiler but the
c-preprocessor. If you consider a macro like this
#define XYZ(a,c,b) \
((a)*(b)*(c))
then in unix format you have
#define XYZ(a,b,c) \{LF}
but in dos format this becomes
#define XYZ(a,b,c) \{CR}{LF}
This is then regarded as
#define XYZ(a,b,c) \{Whitespace}{LF}
and therefore the macro XYZ(0,1,2) is expanded to \.
Oooops.
Patching cpp helps in this case.
For the c-compiler one additional whitespace at the end of each line is
not a problem.
> ~~~~~~~~~~~~~~~~~~~ Kevin Dahlhausen ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Morse Controls ap096@po.cwru.edu
> Thought for the day:
> Book (n): a utensil used to pass time while waiting
> for the TV repairman.
>
> ________________________________________________
> To get help for the crossgcc list, send mail to
> crossgcc-request@cygnus.com with the text 'help'
> (without the quotes) in the body of the message.
>
kind regards,
Rolf
+-----------------+-----------------------------------------+
| _____ | Rolf Fiedler |
| / ___/ | Electronic Design Engineer |
| / _/ | Ferrari electronic GmbH |
| /_/e/r/r/a/r/i/ | phone: +49 3328 4559 0 |
| electronic | E-Mail: Rolf.Fiedler@Ferrari.DE |
| | fax : +49 3328 4559 60 |
+-----------------+-----------------------------------------+
"Where do you want to go tomorrow?"
________________________________________________
To get help for the crossgcc list, send mail to
crossgcc-request@cygnus.com with the text 'help'
(without the quotes) in the body of the message.