Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site allegra.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!karn
From: karn@allegra.UUCP (Phil Karn)
Newsgroups: net.lang.c
Subject: Re: Assignment to pointers to functions returning void
Message-ID: <2326@allegra.UUCP>
Date: Sat, 3-Mar-84 00:18:23 EST
Article-I.D.: allegra.2326
Posted: Sat Mar  3 00:18:23 1984
Date-Received: Sun, 4-Mar-84 00:46:16 EST
References: <245@teltone.UUCP>
Organization: Bell Communications Research, Inc
Lines: 30

By wild coincidence, after hundreds of net.lang.c articles with esoteric
and/or uninteresting problems, I see two in a row that I've just
encountered.

I haven't gotten any compiler error messages when assigning the address
of a function which retuns null to a pointer of that type, but lint does
complain bitterly.  Some lints (such as the System V) have this fixed.
I just put up with the noise. If you don't like that, a temporary fix
of the form

#define void int

will quiet things down until you get a fixed lint.

I too was looking for a clean way to declare a pointer to the end of a
structure within a structure, but I think you can get the effect you
want with a little simple pointer arithmetic and casting:

struct foo {
	int retch;
	int bletch;
};

struct foo *foop;
char *charp;

foop = (struct foo *)malloc(100);
charp = (char *)(foop + 1);

--Phil