This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: generalized lvalues


Michael Matz wrote:

Hi,

On Thu, 18 Nov 2004, Matt Austern wrote:



But I'll give two examples (details changed partly to protect the guilty and
partly because I'm doing this by memory):
(1) #define foo(x) *(a, b, x)
(2) ((long*) p)++



Actually, from my experience looking at assorted packages which are tried
to be build with 4.0, the latter use is most common. I.e. casting a
pointer to some type to implicitely specify how much it is incremented. Some software is very much known for using such constructs (wine, rpm,
elfutils, dietlibs, many others) . I even tend to say, that such usage is
well defined (within certain limits), although I admit that it's not ISO
C99.


<rant>
All the whining about how unspecified this is, and how the writer of the
code deserve to be bitten, is just language lawyer masturbation (which I
also very much enjoy when closing bugreports about this or that compiler
bug with INVALID), but it doesn't change the fact, that there are quite
some packages out there actually using such extensions. This cast-as-lvalue extension removal is one of the bigger items which result in much work for package maintainers (not so much for C++, as there anyway this extension wasn't used much).
</rant>


So, if anyone wants to bring it back, with defined semantics of course
(like for instance memory accessed through a casted pointer is well
defined (not outside the memory for the object accessed), and only for C) I'm all ears.



Ciao, Michael.



Micheal, GCC 4.0 looks cool. I have the latest CVS. http://www.geocities.com/bobbymcn2004 will take you to a site of music that was made with a program using GCC 4.0.
Under Cygwin.
All my latest music is there. This is my dream. You guys have done it. GCC has come a long way since I started with you four years ago with GCC 3.0. I'm using Cygwin. One problem. The songs are encoded in Windows Media Encoder, so you need a player that plays wma files.
There's not that many. And yes, that's me playing the piano. Neat.
GCC 4.0, when its released will be appreciated by all.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]