This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] fix some -Wundef warnings
- From: Chris Metcalf <cmetcalf at ezchip dot com>
- To: GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Fri, 26 Dec 2014 19:03:13 -0500
- Subject: [PATCH] fix some -Wundef warnings
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp dot mailfrom=cmetcalf at ezchip dot com;
While I was fixing -Werror warnings I noticed a couple that haven't
yet become fatal (since we are waiting on -Wundef to be added) but I
figured I might as well fix them. Any reason not to commit these?
They both seem very straightforward.
2014-12-26 Chris Metcalf <cmetcalf@ezchip.com>
* sysdeps/unix/sysv/linux/tst-setgetname.c (do_test): Use #ifndef
instead of #if to avoid a Wundef warning.
* stdlib/tst-limits.c (do_test): Likewise.
diff --git a/sysdeps/unix/sysv/linux/tst-setgetname.c b/sysdeps/unix/sysv/linux/tst-setgetname.c
index f5693e26c422..7799ebe57bc3 100644
--- a/sysdeps/unix/sysv/linux/tst-setgetname.c
+++ b/sysdeps/unix/sysv/linux/tst-setgetname.c
@@ -101,7 +101,7 @@ do_test (int argc, char **argv)
{
res = get_self_comm (gettid (), name_check, TASK_COMM_LEN);
-#if !__ASSUME_PROC_PID_TASK_COMM
+#ifndef __ASSUME_PROC_PID_TASK_COMM
/* On this first test we look for ENOENT to be returned from
get_self_comm to indicate that the kernel is older than
2.6.33 and doesn't contain comm within the proc structure.
diff --git a/stdlib/tst-limits.c b/stdlib/tst-limits.c
index 6e51dcadb5ba..9aabc360f6b8 100644
--- a/stdlib/tst-limits.c
+++ b/stdlib/tst-limits.c
@@ -58,7 +58,7 @@ do_test (void)
/* Values from POSIX and Unix. */
#ifdef PAGESIZE
TEST (PAGESIZE, "d", getpagesize ());
-#elif PAGE_SIZE
+#elif defined (PAGE_SIZE)
TEST (PAGE_SIZE, "d", getpagesize ());
#endif
--
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com