🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1101

Interpretation of volatile - two questions

#1101
From: Ronald Guilmette
Date: Mon, 19 Mar 1990 09:28
31 lines
1070 bytes
Assume you have the following structure:

	struct s {
		char		c1;
		volatile char	c2;
	};

Now assume that you also have:

	struct s *memory_mapped_device_p = (struct s *) 0xffffff80;

Now if you also have:

	void foo ()
	{
		char c;

		c = memory_mapped_device_p->c1;
	}

does the standard (a) permit, (b) require, or (c) prohibit the assignment
statement shown to access the c2 field of the "struct s" pointed to by
memory_mapped_device_p?

This could be important in cases where you have certain locations which
(when read) produce side-effects.


// Ron Guilmette (rfg@ics.uci.edu)
// C++ Entomologist
// Motto:  If it sticks, force it.  If it breaks, it needed replacing anyway.
Technical Details
Message-ID: <2604A628.8521@paris.ics.uci.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!jarthur!uci-ics!gateway

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!jarthur!uci-ics!gateway
From: rfg@paris.ics.uci.edu (Ronald Guilmette)
Newsgroups: comp.std.c
Subject: Interpretation of volatile - two questions
Message-ID: <2604A628.8521@paris.ics.uci.edu>
Date: 19 Mar 90 09:28:08 GMT
Organization: UC Irvine Department of ICS
Lines: 31