quoted
quoted
quoted
quoted
Takashi Oe writes:
quoted
Even if the default is to do nothing, one always should provide a
default action or just break so that the density / coverage of the switch
statement cases is apparent.
Takashi> I don't know what the density is, but, if having a default action for
Takashi> nothing is always prefered, I'll fix it (or rather I'll ask Ben to fix
Takashi> it.) Is it in gcc documentation or C standard somewhere?
It's not in the documentation or in the standard. It is good, but
not a requirements. It helps document that the programmer knows what is
expected and sometimes helps the compiler generate better code by knowing
what cases need be considered.
David
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Hi,
On Sun, 6 Aug 2000, David Edelsohn wrote:
quoted
quoted
quoted
quoted
quoted
Takashi Oe writes:
quoted
quoted
Even if the default is to do nothing, one always should provide a
default action or just break so that the density / coverage of the switch
statement cases is apparent.
Takashi> I don't know what the density is, but, if having a default action for
Takashi> nothing is always prefered, I'll fix it (or rather I'll ask Ben to fix
Takashi> it.) Is it in gcc documentation or C standard somewhere?
It's not in the documentation or in the standard. It is good, but
not a requirements. It helps document that the programmer knows what is
expected and sometimes helps the compiler generate better code by knowing
what cases need be considered.
Thank you for the explanation. Actually, I used to put a default action
always with a switch statement because that's how I was taught when I
first learned to code in C, well, until I came across a code in Linux
kernel which had a switch statement without a default action. At first I
was skeptical, but I realized I can save two lines of typing that way when
there is nothing to do for default, and I got accustomed to code similarly
rather quickly. But, if it helps the compiler, I can type the extra two
lines as I used to. No problem.
By the way, has anyone noticed compiling arch/ppc/mm/init.c takes very
long time? On my machine, it takes as long as about two minutes to just
compile it, while compiling other files are almost instantaneous. Well,
it's one of the biggest C files, but, still, I wonder if we can organize
the code a bit to help the compiler somehow. Perhaps, my machine is too
slow?
Takashi Oe
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
At 1:01 AM -0500 8/6/00, Takashi Oe wrote:
By the way, has anyone noticed compiling arch/ppc/mm/init.c takes very
long time? On my machine, it takes as long as about two minutes to just
compile it, while compiling other files are almost instantaneous. Well,
it's one of the biggest C files, but, still, I wonder if we can organize
the code a bit to help the compiler somehow. Perhaps, my machine is too
slow?
Something odd is going on. 2 minutes is way too long. I just did:
rm arch/ppc/mm/init.o
make
on a 2.2.17pre13 tree which was otherwise fully compiled and watched
for make to start compiling init.c. It took less than a second to
compile.
My computer is very fast, but it can't be that much faster than
yours! Perhaps you are consistently hitting some VM thrashing at
that point in a full kernel build?
Tim Seufert
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
On Sun, 6 Aug 2000, Timothy A. Seufert wrote:
At 1:01 AM -0500 8/6/00, Takashi Oe wrote:
quoted
By the way, has anyone noticed compiling arch/ppc/mm/init.c takes very
long time? On my machine, it takes as long as about two minutes to just
compile it, while compiling other files are almost instantaneous. Well,
it's one of the biggest C files, but, still, I wonder if we can organize
the code a bit to help the compiler somehow. Perhaps, my machine is too
slow?
Something odd is going on. 2 minutes is way too long. I just did:
rm arch/ppc/mm/init.o
make
on a 2.2.17pre13 tree which was otherwise fully compiled and watched
for make to start compiling init.c. It took less than a second to
compile.
Hmm, that's true. I mean, on 2.2.x tree, it takes about five seconds even
with my slow machine, which is comparable to your result. I've noticed
the long compile time for arch/ppc/mm/init.c on 2.4.x tree.
My computer is very fast, but it can't be that much faster than
yours! Perhaps you are consistently hitting some VM thrashing at
that point in a full kernel build?
I've just tried vmstat during the compilation, but I didn't see
anything...
Takashi Oe
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/