🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #754

Funny statement in docs

#754
From: Michael Tiemann
Date: Fri, 19 Jan 1990 23:42
27 lines
1145 bytes
   Date: Tue, 16 Jan 90 22:28:04 EST
   From: ngo%tammy@harvard.harvard.edu (Tom Ngo)


   I think this declaration, found in the g++ info file in the node
   "Function Attributes", looks like a contradiction to me.  Tell me if
   I'm wrong:

	extern const void square ();

   A function declared "const" has no effect but its return value, no?
   A void function returns nothing, no?

   --Tom

Nothing funny about this at all.  The `const' in this example does not
modify `void', it says that the function is `functional', and that cse
can optimize away calls:

	int i = square (a);
	int j = square (b);

	if (i == j)
	  // cse knows this to be true.

Michael
Technical Details
Message-ID: <9001192342.AA03744@teacake.sun.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!SUN.COM!tiemann
References: <9001170331.AA05937@life.ai.mit.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!SUN.COM!tiemann
From: tiemann@SUN.COM (Michael Tiemann)
Newsgroups: gnu.g++.bug
Subject: Funny statement in docs
Message-ID: <9001192342.AA03744@teacake.sun.com>
Date: 19 Jan 90 23:42:53 GMT
References: <9001170331.AA05937@life.ai.mit.edu>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: tiemann@sun.com
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 27