comp.lang.c
[Top] [All Lists]

Re: valid static-initializer list values...

Subject: Re: valid static-initializer list values...
From: "Chris Thomasson"
Date: Fri, 28 Mar 2008 23:28:37 -0700
Newsgroups: comp.lang.c


"Chris Thomasson" <cristom@xxxxxxxxxxx> wrote in message news:0qSdnS6eRI-hQXDanZ2dnUVZ_hisnZ2d@xxxxxxxxxxxxxx
"Harald van Dijk" <truedfx@xxxxxxxxx> wrote in message news:9fa4f$47e0a176$541dfcd3$5814@xxxxxxxxxxxxxxxxxxxxxxxxxxx
On Tue, 18 Mar 2008 21:52:41 -0700, Chris Thomasson wrote:
Simple question, does the program below fall victim to
undefined-behavior?
[...]
This is fine. You can use -> in constant expressions, so long as you
don't try to read from any object. Since you only use -> to immediately
take the result's address, there's no problem.

Okay; here is another one:
________________________________________________________________
[...]
________________________________________________________________


Is there anything wrong with that?

Well, this is definitely not going to work. I wanted to be able to fully initialize 'mem_heap' objects using an initializer list so that I could avoid calling an explicit 'mem_heap_init()' function; oh well.

;^(

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy