🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3941

Re: Safety. Was: Re: Pointers

#3941
From: Darren New
Date: Wed, 16 Dec 1992 16:48
33 lines
1664 bytes
I have never seen iasf before. 

If memory serves, the body of iasf was posted in the same line where it
was used.  Basically, an inlined-function version of the union punning.

> But I am more interested in this for variables than for constants,
> although it is often needed at the present time for constants.

It would certainly work for variables.

> 	use_double(c,d)

> where, for example, c and d would be 32-bit objects and double is 64-bit.

This is a trivial modification, using a union with two 32-bit objects
overlapping one 64-bit object.

However, C cannot choose different functions based on that their value
is returned as.  What should it do if you say

process(use_double(c,d))

and you haven't declared what types "process" uses returns.  It's a tiny
amount of work to use different functions depending on what you want to
pass and what you want back, compared to actually getting it to work.

        -- Darren (can't believe I'm getting pulled into this again) New.

Darren New, MTS <dnew@thumper.bellcore.com> (MIME compliant)
445 South St/MRE 2E-279/Morristown NJ 07960 USA/(201)829-4833
Delivery of Electronic Multimedia over Networks (DEMON)
Also, formal description techniques, programming languages
``Sometimes, you just have to bite the silver bullet.''
Technical Details
Message-ID: <1992Dec16.164821.19079@walter.bellcore.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!walter!news

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!walter!news
From: Darren New <dnew@thumper.bellcore.com>
Subject: Re: Safety. Was: Re: Pointers
Message-ID: <1992Dec16.164821.19079@walter.bellcore.com>
Sender: news@walter.bellcore.com
Nntp-Posting-Host: bambam.bellcore.com
Organization: Bellcore
Date: Wed, 16 Dec 92 16:48:21 GMT
Lines: 34