From: Chris Friesen <cfriesen@nortelnetworks.com>
To: linux-kernel@vger.kernel.org
Subject: compiler warnings and syscall macros
Date: Mon, 22 Sep 2003 17:35:23 -0400 [thread overview]
Message-ID: <3F6F6B1B.9040609@nortelnetworks.com> (raw)
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.
Would it hurt anything if I put in an explicit cast, like this?
__sc_ret = (unsigned long) -1;
This seems to get rid of the warnings, and I can't imagine it hurting
anything.
Am I missing something bad here?
Chris
--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com
next reply other threads:[~2003-09-22 21:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-22 21:35 Chris Friesen [this message]
2003-09-22 21:51 ` compiler warnings and syscall macros Tommy Reynolds
2003-09-23 14:23 ` Chris Friesen
2003-09-22 22:49 ` H. Peter Anvin
2003-09-22 23:08 ` H. Peter Anvin
2003-09-22 22:49 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F6F6B1B.9040609@nortelnetworks.com \
--to=cfriesen@nortelnetworks.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.