🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x.kde
Article #41

Turn off type casting errors?

#41
From: god_of_pain
Date: Sat, 15 Jan 2000 00:00
48 lines
2219 bytes
Basicly:
I keep getting a type casting error that I need to turn off. Is there an
option for the gcc or g++ compiler that stops it from checking type?


In detail:
I have an embeded system I am working on. I want to compile the code on
my Linux system so I can debug it faster than re-programming the chip. I
am using gcc/g++, KDE desktop and xwpe for an IDE. In my code I have a
struct, I make a pointer to the struct and referance it using the
pointer. The gcc compiler will not compile it because it stops on the
line where I ref. the pointer, because it is not type cast. The embeded
compiler dies if I add the type cast, the makers are tring to find out
why. If I compile it in dos using Borland C++ I can have it either type
cast or not type cast.

//---------
//example
struct test
{
	char first;
	char second;
	char third;
};


struct test far MyTest;
void SomeFunction(char far *StructPointer);

void main(void)
{
	// This line compiles with gcc, not with the embeded compiler
	// This would be the better way to do it, but the embeded
	// compiler could take months to be fixed and I don't want to
	// work in windoze, there should be a way to let gcc ignore the
	// type cast?!? Right?
	SomeFunction((char *)&MyTest);

	// This line compiles with the embeded compiler, not with gcc
	// error for this is
	// parsing MyTest * as argument 1 of SomeFunction(char *);
	// Then it stops.
	SomeFunction(&MyTest);
}


Sent via Deja.com http://www.deja.com/
Before you buy.
Technical Details
Message-ID: <85ogd7$pqb$1@nnrp1.deja.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,6d8e632080002765,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: 10baf0,6d8e632080002765,start
X-Google-Attributes: gid10baf0,public
From: god_of_pain@my-deja.com
Subject: Turn off type casting errors?
Date: 2000/01/15
Message-ID: <85ogd7$pqb$1@nnrp1.deja.com>
X-Deja-AN: 572773275
X-Http-Proxy: 1.0 x38.deja.com:80 (Squid/1.1.22) for client 142.194.118.187
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Sat Jan 15 00:52:59 2000 GMT
X-MyDeja-Info: XMYDJUIDgod_of_pain
Newsgroups: comp.windows.x.kde,gnu.gcc.help
X-Http-User-Agent: Mozilla/4.61 [en] (X11; U; Linux 2.2.12-20 i686)