🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by dave Mon, 06 Apr 1987 16:18
fix to prevent compiler taking address of a register?
#73
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads