On Wed, 10 May 2000, Kenn Humborg wrote:
>> Very odd... I'd expect that the statement
>> (f[i])++
>> would not be legal. Is (var) a legal lvalue? Aha... info gcc
well i initially didn't have brackets. I added them because it seemed
that with:
frequency[input+1]++;
gcc was somehow mis-optimising the ++, so i added the () to try to make it
explicit that i wanted frequency[input-1] evaluated first, and the
increment to be applied to frequency[..].
[snip gcc info]
i'm not doing anything funky like these examples above. i'm just trying to
be explicit about the ordering wrt to the ++ operator.
> > PS: is there anyway to initialise an array at declaration time, rather
> > than iterate thru the array and set each element manually? eg something
> > like: int array[9]=0;
>> You mean like:
>> int array[9]={0, 1, 2, 3, 4, 3, 2, 1, 0};
>> That is standard C.
doh! i'm rusty... just coulnd't remember it.
> GCC also has some extensions that allow
> you to do fancied stuff with initializers.
the : operator, right? don't remember exactly how it works, but something
like:
struct foo {
int var : 0;
char bar : NULL;
} foobar;
it used in a few places in the linux source.
> Take a look at
> the C and C++ Extensions sections in the GCC info pages.
>
still can't understand exactly where "gcc test.c" is fscking up or why,
when "gcc -Ox" works as expected.
How's your x86 asm? :)
> Later,
> Kenn
>
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!