🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #257

Re: Microsoft C return method

#257
From: Doug McDonald
Date: Sun, 08 Apr 1990 16:11
25 lines
1751 bytes
In article <10378@wpi.wpi.edu> jhallen@wpi.wpi.edu (Joseph H Allen) writes:

>Well, Ver 5.0 and up will generate code for both MS-DOS and OS/2, so the
>result code must run under protected mode.  I've also been told by people
>at Microsoft (including one of the lead developers for Windows) that the
>code generated runs under protected mode because it's re-entrant.
>
>| What about returning structures?
>
>I've never used MSC, so I don't know what it does for structures.  However,
>I can't immagine that someone with access to the compiler would have too
>much difficulty finding out.
>

I checked. It returns doubles and structs by putting the values in
static buffers and passing a pointer to those buffers on the stack.
Thus the resulting subroutines are not re-entrant, and hence Microsoft C
5.1 is not ANSI C. This will have to be fixed to be standard ANSI C,
which requires that any subroutine be callable from a signal handler
(i.e. asynchronously). (I don't think that the standard implies that
the USER can't write routines that, because of the way they are written,
aren't reentrant, it just requires that the compiler provide a way to
return any value correctly. )

Doug McDonald
Technical Details
Message-ID: <1990Apr8.161144.4008@ux1.cso.uiuc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!aries!mcdonald

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!aries!mcdonald
From: mcdonald@aries.scs.uiuc.edu (Doug McDonald)
Newsgroups: comp.sys.ibm.pc.programmer
Subject: Re: Microsoft C return method
Message-ID: <1990Apr8.161144.4008@ux1.cso.uiuc.edu>
Date: 8 Apr 90 16:11:44 GMT
Sender: usenet@ux1.cso.uiuc.edu (News)
Reply-To: mcdonald@aries.scs.uiuc.edu (Doug McDonald)
Organization: School of Chemical Sciences, Univ. of Illinois at Urbana-Champaign
Lines: 25