Article View: comp.std.c
Article #71Re: on "use", and the lvalue-ness of string literals
From: Blair P. Houghton
Date: Thu, 05 Nov 1992 01:20
Date: Thu, 05 Nov 1992 01:20
49 lines
2326 bytes
2326 bytes
In article <18106@ksr.com> jfw@ksr.com (John F. Woods) writes: >I'm not even sure that I know what you want to mean by "use". Welcome to the world of circular argument. If I was sure, I wouldn't have asked. >the expression statement [ foo; ] >the object named by the identifier "foo" and then discards >the value of that object. "Discards," does not "use." "Access" is a different thing from "use". In fact, "use" is only used in context with "the value of." So it is not the identifier or the location that matter, it is the value, and whether it gets "used" or not. >One would think that if "foo" were declared as >"volatile", the object designated by "foo" here *must* be accessed in a >running program. The definitive answer, if one can call it that, is to be >found in section 3.5.3 "Type Qualifiers" of the ANSI standard: "What >constitutes an access to an object that has volatile-qualified type is >implementation-defined." I considered volatile-ness only long enough to realize that it was mooted by the fact that "issues of optimization are irrelevant:" one must assume that the abstract machine may perform the implied access, whether the identifier is declared volatile or not. What is done with the value retrieved is another matter. >Others have hammered the "non-modifiable lvalue" answer to death; I'll just >point out that it would have been glaringly obvious had you read the section >entitled "Lvalues and Function Designators"... Like I said, the question about that was "I'm surprised; can this be right?" not "Do you agree with me after my cogent and well-researched dissertation on this problem?" I'm pleased to see, though, that Larry Jones has taken over Doug's old post of "Committee Member with Chip on Shoulder." --Blair "All things considered, I'd rather be in Little Rock."
Technical Details
Message-ID:
<1d9stpINNq4e@chnews.intel.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!littlei!hfglobe!chnews!sedona!bhoughtoReferences:
<1992Nov2.162310.10094@ichips.intel.com> <18106@ksr.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!littlei!hfglobe!chnews!sedona!bhoughto From: bhoughto@sedona.intel.com (Blair P. Houghton) Newsgroups: comp.std.c Subject: Re: on "use", and the lvalue-ness of string literals Message-ID: <1d9stpINNq4e@chnews.intel.com> Date: 5 Nov 92 01:20:57 GMT References: <1992Nov2.162310.10094@ichips.intel.com> <18106@ksr.com> Organization: Intel Corp., Chandler, Arizona Lines: 49 NNTP-Posting-Host: alfalfa.intel.com