Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: notesfiles
Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!zehntel!hplabs!hp-pcd!hp-dcd!hpdcdb!mike
From: mike@hpdcdb.UUCP (mike)
Newsgroups: net.lang.c
Subject: Re: Non-reentrant code generated by C co
Message-ID: <5300002@hpdcdb.UUCP>
Date: Tue, 14-Aug-84 18:37:00 EDT
Article-I.D.: hpdcdb.5300002
Posted: Tue Aug 14 18:37:00 1984
Date-Received: Mon, 20-Aug-84 01:23:06 EDT
References: <510@calgary.UUCP>
Organization: Hewlett-Packard - Fort Collins, CO
Lines: 17
Nf-ID: #R:calgary:-51000:hpdcdb:5300002:000:794
Nf-From: hpdcdb!mike    Aug 15 14:37:00 1984

The easiest way I found to make structure valued functions reentrant was to
put the return value on the stack and return the location in a scratch
address register (if your machine has them). That has been done on the HP
9000 Series 200 with success.

By the way, I've never seen a real C program that was busted by making
structure valued functions reentrant. This feature has been in our compiler
for 2 years. Note, however, that we use our compiler primarily for system
builds and very little of the system code uses structure valued functions
since it really originated way back before version 1.7. Off hand it's hard
to envision a realistic case that depends on the static location of the value.
If anyone has one I'd like to see it.

				M.F. McNelly
				FSD HP
				Fort Collins, CO.