static declarations & accessibility

ihnp4!wucs1!wuibc2!brown (Michael Brown)
Sun, 13 Dec 87 15:18:15 CST

          From comp.compilers

Related articles
static declarations & accessibility ihnp4!wucs1!wuibc2!brown (1987-12-13)
Re: static declarations & accessibility rsalz@bbn.com (1987-12-15)
Re: static declarations & accessibility wucs1!wuibc2!brown@uunet.UU.NET (1987-12-20)
| List of all articles for this month |

Date: Sun, 13 Dec 87 15:18:15 CST
From: ihnp4!wucs1!wuibc2!brown (Michael Brown)

Since things are slow how about this question?


Do any compilers attempt to protect static data ( static in the sense
of hiding the data in a function or module ) from access outside of
the scope of the declaration?


Is there a system which can change the access modes of the static data
to cause the data to be inaccessible by routines outside of the scope of
the data's declaration?


Has anyone ever tried something like this as a run time consistency check?
Offhand, the efficiency of this sort of scheme in a virtual memory
environment would seem to depend on the overhead in manipulating the
process page table entries on function entry/exit.


All C language implementations I've use have allowed the address of
the static data to be obtained if one wanted to do weird things...
I'd argue that this should be prohibited by the semantics of the
static declaration.


Regards,
Mike Brown Institute for Biomedical Computing
Washington Univ., St. Louis, MO
(314) 362-2135


UUCP: {..., uunet}!wucs1!brown
ARPA: brown@noao.arizona.edu
[I'd argue that a large fraction of the static data that I declare is
prototype structures, e.g. list heads, that I pass all over the place.
But that's a separate issue from the first one you bring up. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.