Re: warnings in 2.1.90 using pgcs

Michael L. Galbraith (mikeg@weiden.de)
Fri, 20 Mar 1998 06:29:30 +0100 (MET)


On Thu, 19 Mar 1998, Christopher W. Fisher wrote:

>
> in file included from /usr/src/linux/include/linux/string.h:39,
> from ide-disk.c:30:
> /usr/src/linux/include/asm/string.h:448: warning: control reaches end of
> non-void function
> /usr/src/linux/include/asm/string.h: In function
> `__constant_c_and_count_memset':
> /usr/src/linux/include/asm/string.h:599: warning: control reaches end of
> non-void function
>
> I am getting this warning in almost every source file.
>

Hello Christopher,

I'm using this to get it to shut up.. OOGLY, but silently produces
assembler identical to the original. The problem is that gcc doesn't
know that all cases are covered, so it warns about a possibly undesired
fall-through.. goodthing(tm) but darned annoying.

-Mike

extern inline void * __constant_c_and_count_memset(void * s, unsigned long pattern, size_t count)
{
switch (count) {
case 0:
goto return_s;
case 1:
*(unsigned char *)s = pattern;
goto return_s;

...

switch (count % 4) {
case 0: COMMON(""); goto return_s;
case 1: COMMON("\n\tstosb"); goto return_s;

...

return_s:
return s;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu