Mail Archives: djgpp/1999/08/27/00:49:29
Thanks a lot Laszlo! I'll try it next week end.
Stay tuned!
Laszlo Molnar wrote:
> > > 2. Need to configure Borland IDE to parse output from GCC (like in
> > > Codewright) *OR* use a perl script to adapt GCC output to Borland
> > > format. I do not think that would be a problem but sincerly haven't
> > > tried it. Anyone did?
>
> Ok, here is what I used 5 years ago. It's full of bugs. It worked for
> me, don't ask me how :-)
>
> Laszlo
>
> ---cut here with a very sharp knife---
>
> /*
> // GCC2MSG V1.0
> // ML1050
> // 1994
> */
>
> /*
> // GNU C Message to Borland C 3.1 Editor Message
> //
> // GNU Transfer Command line:
> // -c -x c $EDNAME -o $OUTNAME $SAVE CUR $MEM(640K) $CAP MSG(GCC2MSG) $NOSWAP
> //
> // OPTIONS/MAKE/After Compiling = Stop ( Don't run TLINK! )
> */
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <io.h>
> #include <fcntl.h>
> #include <string.h>
>
> char header [] = "BI#PIP#OK";
> char separ [] = { 0,1,255,255,1,0 };
> char end [] = { 0,0x7f };
>
> /**************************************/
> void main (void)
> {
> char linein [500];
> char oldfile [200]="\x0\x0*";
> char filenam [200];
> char linenum [200];
> char errorm [500];
> char *ptr;
>
> setmode (1,O_BINARY);
> write (1,header,9);
>
> while (gets (linein) != NULL)
> if (linein [strlen(linein)-1] != ':')
> {
> if ((ptr=strchr (linein,':')) != NULL && *(ptr+1)=='\\')
> *ptr=0xFF;
> sscanf (linein,"%[^:]:%[^:]:%[^\n]",filenam,linenum,errorm);
> if ((ptr=strchr (filenam,0xFF)) != NULL)
> *ptr=':';
> if (strcmp (filenam,oldfile+2))
> {
> strcpy (oldfile+2,filenam);
> write (1,oldfile,strlen (filenam)+2);
> }
> *(short*) (separ+2) = atoi (linenum);
> write (1,separ,6);
> for (ptr=errorm; *ptr==' '; ptr++)
> ;
> write (1,ptr,strlen (ptr));
> }
> write (1,end,2);
> close (1);
> }
- Raw text -