Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Uncle Steve Newsgroups: comp.lang.c Subject: Re: Non-constant initializers Date: Sun, 15 May 2011 13:26:57 -0400 Organization: Friends of the Galactic Collective Lines: 45 Message-ID: <6a050bb5569ef14-16a9a@gmail.com> References: <9322eedb3a632f5-29a98@gmail.com> <70b21f510c7390e-cc0de@gmail.com> <92f904404cb7d63-61def@gmail.com> <0.6ca601d4a6214c706d15.20110515040125BST.878vu8y8e2.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Injection-Info: mx03.eternal-september.org; posting-host="9mti4zl2mrQmHFyxsa0q3g"; logging-data="32208"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+mbL45iIVpsgjlHJcnvsuP" User-Agent: nn 6.7.3 Content-Length: 1682 Cancel-Lock: sha1:pMWLQ0SlBVoN4PjPieyAakzNTrM= Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:4031 On Sun, May 15, 2011 at 04:01:25AM +0100, Ben Bacarisse wrote: > Uncle Steve writes: > > > On Sat, May 14, 2011 at 05:45:49PM -0400, Eric Sosman wrote: > >> On 5/14/2011 3:25 PM, Uncle Steve wrote: > > >> >It could do just about anything if it was a C function, couldn't it? > >> > >> C functions cannot return arrays, nor can they return array > >> initializers. > > > > Hmm. I'm not sure why you think that's important. > > It's right there in the quotes. You asked if "it" (referring to your > howmuchfoo function) "could do just about anything if it was a C > function, couldn't it?". Eric answered by pointing out two things that > it could *not* do. What's more, these are things that might be > significant since the code fragment you showed: > > | int foops[] = howmuchfoo(void); > > suggested that howmuchfoo might be either returning an array or it might > be trying to return an array initialiser. But only if it was a macro. I'm not likely to use that exact scenario in real code, perhaps I hammered out my initial example a little too quickly. I don't pretend to be an expert on C grammar. Too often the compiler identifies my typos and coding errors so I guess it may be obvious I don't use a syntax-highlighting editor. In any case, I'm not hung up on what kind of data is returned from a function call in this usage scenario. It may vary well come from a file containing random data owing to filesystem corruption from bashing my head on the keyboard of my notebook. ;) Regards, Uncle Steve -- Should a professional politician be charged with molestation if he kisses babies while attending political rallies?