[Coco] c_prep 1.9 oddity

Stephen H. Fischer SFischer1 at Mindspring.com
Fri May 27 22:36:59 EDT 2016


You might have better luck with the "C" set of programs that Willard and I built. 

The .dsk is attached to this post:

http://www.tandycoco.com/coco-forum/topic?p=529#p529

Willard was the last person to work on C_PREP but he appears to have left us.

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


>I have noticed some strange things when using c_prep 1.9 to compile code
> that I run across.
> 
> Here are the specifics:
> 
> C_PREP by Jim McDowell with version 1.9 updates by Gene Heskett
> 
> I am using cc version 2.5.2 to compile which uses the module named c_prep
> as the preprocessor.  Below is the ident information so we know exactly
> what version I am working with here.
> 
> (Plug for DriveWire here. Copied and pasted here from Windows telnet.)
> 
> DriveWire Telnet Server 4.3.3o
> 
> NitrOS-9/6309 Level 2 V3.3.0 on the Tandy Color Computer 3  2016/05/27
> 21:05:58
> 
> 
> User name?: su
> 
> Process #03 logged on   2016/05/27 21:06:00
> Welcome!
> 
> Welcome to NitrOS-9 Level 2 V3.3.0 HD6309 Enhanced
> On the Tandy Color Computer 3
> 
> Shell+ v2.2a 16/05/27 21:06:00
> 
> {N2|03}/DD:ident -x c_prep
> 
> Header for:  c_prep
> Module size: $520D    #21005
> Module CRC:  $B07C0E (Good)
> Hdr parity:  $77
> Exec. off:   $0021    #33
> Data Size:   $781E    #30750
> Edition:     $09      #9
> Ty/La At/Rv: $11 $81
> Prog mod, 6809 obj, re-en, R/O
> 
> 
> So 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 a
> utility called CUTS, version 1.6.  When cuts.c is run through c_prep 1.9 I
> get an error.  The error is in shown here:
> 
> (Note: I use a different makefile than the one included in the RTSI archive
> of CUTS 1.6)
> 
> [Error Output from c.pass1]
> {N2|03}/DD/USR/SRC/CUTS/SRC:make
> cc -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.a
> cuts.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.c
> 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 [ 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 data
> type "file_type" making it "file _type".  Microware C c.prep shortens the
> variable name of the data type "file_type" to "file_typ" (shortened to 8
> characters) 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 Microware
> c.prep.
> 
> William Carlin
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list