[Coco] c_prep 1.9 oddity

Bill Pierce ooogalapasooo at aol.com
Fri May 27 23:32:54 EDT 2016


William, I've tried c_prep 18, 19 & 19b and I've had problems with all of them. My problems were mostly memory problems more than anything. It's seems from somewhere around 18-19, memory for labels as well as line length were reduced to make room for more features (change notes state they were reduced to about 1/3rd). I kept getting line length and out of label space errors so I just dropped back to MW c.prep and have no problems.
I compile HUGE multi-sources, multi module projects... 10-30 sources per module, with multiple modules per compile, and I use:

Rcr (Mike Knudsen's replacement for cc, allows use of a ramdisk & Tim Koonce's "make")
c.prep (Microware)
c.comp (from the nitros9 repo "NitrOS9/3rdparty/cc/c.comp")
CnoY (Mike Knudsen, changes all "leax xxx,y" to "ldx #xxx")
c.opt (Microware)
RMA (Microware)
R.Link (Microware)

I also use Carl Kreider's "clib.l", Mike Sweet's "cgfx.l", and Tim Koonce's "make".

 
When compiling "library files" (i.e. "clib.l" etc), I have to use MW's "c.asm" as "RMA" seems to add an extra "0" to the end of the object file and library object files will not merge correctly. This is not a problem with regualar modules using "R.Link", only RELs that are to be merged and NOT linked (like libraries).

Currently, my "MShell" project compiles about 19-20 modules, (100+ sources) from one "makefile" without a hitch.

BTW... No need to jump through hoops to get screen data to the PC with Drivwire4.... just use DW4's "virtual printer". Redirect the stdout to /p (exmp: "dir >/p") and it will print to a file in your "Drivewire4/cocoprints" folder :-)
You must have "scdwp.dr" & "p_scdwp.dd" in your boot for this to work. These are standard in the current NitrOS9 disk image releases.

 


Bill Pierce
"Charlie stole the handle, and the train it won't stop going, no way to slow down!" - Ian Anderson - Jethro Tull

 

My Music from the Tandy/Radio Shack Color Computer 2 & 3
https://sites.google.com/site/dabarnstudio/
Co-Contributor, Co-Editor for CocoPedia
http://www.cocopedia.com/wiki/index.php/Main_Page
Global Moderator for TRS-80/Tandy Color Computer Forums
http://www.tandycoco.com/forum/

E-Mail: ooogalapasooo at aol.com


 

 

-----Original Message-----
From: William Carlin <whcarlinjr at gmail.com>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Fri, May 27, 2016 10:12 pm
Subject: [Coco] c_prep 1.9 oddity

I have noticed some strange things when using c_prep 1.9 to compile codethat I run across.Here are the specifics:C_PREP by Jim McDowell with version 1.9 updates by Gene HeskettI am using cc version 2.5.2 to compile which uses the module named c_prepas the preprocessor.  Below is the ident information so we know exactlywhat version I am working with here.(Plug for DriveWire here. Copied and pasted here from Windows telnet.)DriveWire Telnet Server 4.3.3oNitrOS-9/6309 Level 2 V3.3.0 on the Tandy Color Computer 3  2016/05/2721:05:58User name?: suProcess #03 logged on   2016/05/27 21:06:00Welcome!Welcome to NitrOS-9 Level 2 V3.3.0 HD6309 EnhancedOn the Tandy Color Computer 3Shell+ v2.2a 16/05/27 21:06:00{N2|03}/DD:ident -x c_prepHeader for:  c_prepModule size: $520D    #21005Module CRC:  $B07C0E (Good)Hdr parity:  $77Exec. off:   $0021    #33Data Size:   $781E    #30750Edition:     $09      #9Ty/La At/Rv: $11 $81Prog mod, 6809 obj, re-en, R/OSo I am running through some OS-9 software from a hard disk image named'RTSI Archives 01 OS9 RSDOS.vhd' and come across the source code for autility called CUTS, version 1.6.  When cuts.c is run through c_prep 1.9 Iget an error.  The error is in shown here:(Note: I use a different makefile than the one included in the RTSI archiveof CUTS 1.6)[Error Output from c.pass1]{N2|03}/DD/USR/SRC/CUTS/SRC:makecc -dOS9 -T=/r0 -r=../RELS cuts.c cc version 2.5.2'cuts.c'   c_prep :   -DOS9 cuts.c   c.pass1:   /r0/ctmp.12.m -o=/r0/ctmp.12.acuts.c : line 108  ****  undeclared variable  ****names [ nfiles ] .file _type = 3 ;                  ^cuts.c : line 108  ****  struct member required  ****names [ nfiles ] .file _type = 3 ;                  ^cuts.c : line 108  ****  ; expected  ****names [ nfiles ] .file _type = 3 ;  ^cuts.c : line 108  ****  undeclared variable  ****names [ nfiles ] .file _type = 3 ;[END]c_prep 1.9 seems to be mangling the data type name "file_type" to "file_type".Here is the relevant source code:[cuts.c]...typedef struct{   int  file_type;   char *name;} namestype;main (argc,argv)...   int c, i, decoder=0, encoder=0, outputfile=0, nfiles=0;...   namestype names[MAXNAMES];...         case 'm':            names[nfiles].file_type = MACHINEFILE;  /* Line 108 */         names[nfiles++].name    = optarg;            break;...[END][output from c_prep 1.9]...cuts.ccuts_c...typedef struct{int file_type ;char * name ;} namestype ;...main ( argc , argv )...int c , i , decoder = 0 , encoder = 0 , outputfile = 0 , nfiles = 0 ;...namestype names [ 25 ] ;...case 'm' :names [ nfiles ] .file _type = 3 ;names [ nfiles ++ ] .name = optarg ;break ;...[END][output from Microware C c.prep]...typedef struct{ int file_typ; char *name;} namestyp;main(argc,argv)... int c, i, decoder=0, encoder=0, outputfi=0, nfiles=0;... namestyp names[25];...case 'm':names[nfiles].file_typ = 3;names[nfiles++].name = optarg;break;...[END]The output from c_prep 1.9 adds a space to the variable name of the datatype "file_type" making it "file _type".  Microware C c.prep shortens thevariable name of the data type "file_type" to "file_typ" (shortened to 8characters) but not adding in the space before the underscore.Do any OS-9 C programmers have some insight into why c_prep 1.9 does this?I had always assumed that it was a drop in replacement for the Microwarec.prep.William Carlin-- Coco mailing listCoco at maltedmedia.comhttps://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list