🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #3691

Bug in Lattice C 5.04?

#3691
From: M Gordon
Date: Thu, 31 May 1990 08:06
60 lines
1748 bytes
I have recently started looking at IFF files and the following is the beginningsof a very simple IFF reader. Unfortunately it won't compile - no warnings or
error messages except CXERR 99. Since the compiler internal errors in the
manual only go up to about 35 I am totally stuck.
The program is so simple that someone must have seen this bug before. What can
I do to get around it?

--------------------------------------------------------------------------------
typedef union {
	char chid[4];
	long id;
} ID;

typedef struct {
	ID ckID;
	long ckSize;
} ckHeader;


#include <stdio.h>

void printID(ID idu)
{
	putchar(idu.chid[0]);
	putchar(idu.chid[1]);
	putchar(idu.chid[2]);
	putchar(idu.chid[3]);
}

main(int argc,char **argv)
{
	FILE *in;
	ckHeader header;
	ID type;

	if (argc!=2)
	{
		fprintf(stderr,"usage: listiff filename\n");
		exit(1);
	}

	if ((in=fopen(argv[1],"r"))==NULL)
	{
		perror(argv[1]);
		exit(1);
	}

	fread((char *)&header,sizeof(header),1,in);

	printID(header.ckID);
	printf(" %ld bytes\n ",header.ckSize);

	fread((char *)&type,sizeof(type),1,in);
	printID(type);
}

-- 
							 _   _   _    _   _	
Michael Gordon - mfg@castle.ed.ac.uk OR ee.ed.ac.uk	| |_| |_| |__| |_| |   
							| . . . .      . . |    
I spilt spot remover on my dog and now he's gone! 	|_________|~~|_____|    
Technical Details
Message-ID: <4369@castle.ed.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!edcastle!mfg

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!edcastle!mfg
From: mfg@castle.ed.ac.uk (M Gordon)
Newsgroups: comp.sys.amiga.tech
Subject: Bug in Lattice C 5.04?
Message-ID: <4369@castle.ed.ac.uk>
Date: 31 May 90 08:06:18 GMT
Reply-To: mfg@castle.ed.ac.uk (M Gordon)
Organization: Edinburgh University Electrical Engineering
Lines: 60