about summary refs log tree commit diff
path: root/ChangeLog
diff options
context:
space:
mode:
authorArjun Shankar <arjun.is@lostca.se>2015-05-18 12:28:06 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2015-05-18 12:28:06 +0530
commit330fadfc62498041c838cba3a0413bb9c715b73f (patch)
tree848d985164199b0e37402a45fc17b78c9fa86636 /ChangeLog
parentb40a4e1a7bf7000018a8d1d1ee2f37f5c63e5a42 (diff)
downloadglibc-330fadfc62498041c838cba3a0413bb9c715b73f.tar.gz
glibc-330fadfc62498041c838cba3a0413bb9c715b73f.tar.xz
glibc-330fadfc62498041c838cba3a0413bb9c715b73f.zip
Ensure `wint_t' is defined before use in include/stdio.h
While trying to get nptl/tst-initializers1.c to include the test skeleton, I
came across a couple of speed bumps. Firstly: after making the appropriate
changes to the test, running `make check' led to this error:

> In file included from ../malloc/malloc.h:24:0,
..
>                  from tst-initializers1.c:60:
> ../include/stdio.h:111:1: error: unknown type name `wint_t'
>  extern wint_t __getwc_unlocked (FILE *__fp);

So, `wint_t' is used before being defined. Question: Why did test-skeleton.c
not cause this error in any of the other tests that include it?

Anyway, I noticed include/stdio.h includes stddef.h, which in turn defines
`wint_t', but only if `__need_wint_t' is defined. So I put in a
`#define __need_wint_t' before the include to get rid of the error. Is that
the correct fix?

A subsequent `make && make check' led to this second error:

>                  from tst-initializers1-c89.c:1:
> ../test-skeleton.c: In function `main':
> ../test-skeleton.c:356:11: error: `for' loop initial declarations are only
>  allowed in C99 mode
>            for (struct temp_name_list *n = temp_name_list;

Although there seem to be several other C89 no-noes in test-skeleton.c, I
needed only to fix this specific one for gcc-4.8.3 to stop complaining.
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog6
1 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a2878a25a..4de8a25c28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-05-18  Arjun Shankar  <arjun.is@lostca.se>
+
+	* include/stdio.h: Define __need_wint_t.
+	* test-skeleton.c: Avoid `for' loop initial declaration.
+	* nptl/tst-initializers1.c: Use test-skeleton.c.
+
 2015-05-17  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	[BZ #18418]