From: Keith Owens <kaos@ocs.com.au>
To: linux-kernel@vger.kernel.org
Cc: torvalds@transmeta.com
Subject: 2.4.9 new min/max definitions are buggy
Date: Wed, 22 Aug 2001 13:38:38 +1000 [thread overview]
Message-ID: <9140.998451518@kao2.melbourne.sgi.com> (raw)
Leaving aside the question of whether the new min/max functions are
sane or not, the 2.4.9 definitions are buggy. If type is a pointer
like char *, __x takes pointer type, __y takes base type, splat!
Index: 9.1/include/linux/kernel.h
--- 9.1/include/linux/kernel.h Tue, 21 Aug 2001 16:48:26 +1000 kaos (linux-2.4/g/b/11_kernel.h 1.1.1.5 644)
+++ 9.1(w)/include/linux/kernel.h Wed, 22 Aug 2001 13:33:28 +1000 kaos (linux-2.4/g/b/11_kernel.h 1.1.1.5 644)
@@ -113,9 +113,9 @@ static inline void console_verbose(void)
((unsigned char *)&addr)[0]
#define min(type,x,y) \
- ({ type __x = (x), __y = (y); __x < __y ? __x: __y; })
+ ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
#define max(type,x,y) \
- ({ type __x = (x), __y = (y); __x > __y ? __x: __y; })
+ ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
#endif /* __KERNEL__ */
reply other threads:[~2001-08-22 3:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=9140.998451518@kao2.melbourne.sgi.com \
--to=kaos@ocs.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).