🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Graham D Parrington Fri, 29 Aug 1986 12:10
Version 1.0 type coercion problems
#294
Author: Graham D Parrington
Date: Fri, 29 Aug 1986 12:10
27 lines
1428 bytes
The following program generates an error from the 1.0 version of C++

extern void Set(char *);

void Test (char a)
{
	Set(&a);
}

The error message is:

"Test.c", line 5: error: bad argument 1 type for Set(): int * (char * expected)

The problem appears to be that the argument 'a' to Test is forced to int by
cfront so that taking its address gives an int* rather than the required
char*. Putting in an explicit coercion or assigning 'a' to a local and passing
that instead cures the problem. Unfortunately fragments of code like the
above are generated automatically by an RPC stub generator we are writing.

Does anybody have a fix for this for 1.0 and does the problem persist into
1.1?

Graham D Parrington
    Computing Lab, University of Newcastle upon Tyne, UK

ARPA:    graham%cheviot.newcastle.ac.uk@cs.ucl.ac.uk
UUCP:    <UK>!ukc!cheviot!graham
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads