🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.misc
Article #73

fix to prevent compiler taking address of a register?

#73
From: dave
Date: Mon, 06 Apr 1987 16:18
24 lines
1458 bytes
I'm running Edition VII Workbench (with source) on a Perkin-Elmer
3220 system. This is basically UNIX v7.

I just got bitten by what I consider a compiler bug. I changed
a number of "int" declarations to "register" in a program I was
making some changes to, not realizing that one of them had its
address used (i.e., "int status" ... "wait(&status)").

Now, I don't mind if the compiler gives me an error, and I don't
mind if it decides that "status" can't be a register after all
and puts it in memory. Either of these is consistent with K&R
pp. 81 and 193, which state that one cannot take the address of
a register.

What I didn't care for is the compiler accepting the code, then
having the program dump core at run-time. Does anyone have a fix
to the v7 compiler which would handle this, or can someone at least
point me at how to solve it? Thanks.

David Sherman
The Law Society of Upper Canada
Toronto
-- 
{ seismo!mnetor  cbosgd!utgpu  watmath  decvax!utcsri  ihnp4!utzoo } !lsuc!dave
Technical Details
Message-ID: <1693@lsuc.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!lsuc!dave

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!lsuc!dave
From: dave@lsuc.UUCP
Newsgroups: comp.bugs.misc,comp.unix.wizards
Subject: fix to prevent compiler taking address of a register?
Message-ID: <1693@lsuc.UUCP>
Date: Mon, 6-Apr-87 11:18:15 EST
Article-I.D.: lsuc.1693
Posted: Mon Apr  6 11:18:15 1987
Date-Received: Mon, 6-Apr-87 23:45:18 EST
Organization: Law Society of Upper Canada, Toronto
Lines: 24