Re: compiler warnings and syscall macros

From: H. Peter Anvin
Date: Mon Sep 22 2003 - 17:55:57 EST


Followup to: <3F6F6B1B.9040609@xxxxxxxxxxxxxxxxxx>
By author: Chris Friesen <cfriesen@xxxxxxxxxxxxxxxxxx>
In newsgroup: linux.dev.kernel
>
>
> I'm trying to figure something out. For ppc, in asm/unistd.h,
> __syscall_nr is defined as:
>
>
> #define __syscall_nr(nr, type, name, args...) \
> unsigned long __sc_ret, __sc_err; \
> { \
> <snipped for brevity>
> } \
> if (__sc_err & 0x10000000) \
> { \
> errno = __sc_ret; \
> __sc_ret = -1; \
> } \
> return (type) __sc_ret
>
>
> Whenever I use this in my code, I get compiler warnings about the
> statment "__sc_ret = -1" since it is assigning a negative value to an
> unsigned int.

Just do:

__sc_ret = -1UL;

-hpa
--
<hpa@xxxxxxxxxxxxx> at work, <hpa@xxxxxxxxx> in private!
If you send me mail in HTML format I will assume it's spam.
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/