diff mbox

Add missing include to posix/tst-dir.c

Message ID 1456149467-19460-1-git-send-email-tuliom@linux.vnet.ibm.com
State New
Headers show

Commit Message

Tulio Magno Quites Machado Filho Feb. 22, 2016, 1:57 p.m. UTC
A recent change to posix/tst-dir.c started to use macros from
libc-internal.h but didn't include it, causing build issues.

2016-02-22  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>

	* posix/tst-dir.c: Include libc-internal.h.
---
 posix/tst-dir.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Florian Weimer Feb. 22, 2016, 1:59 p.m. UTC | #1
* Tulio Magno Quites Machado Filho:

> A recent change to posix/tst-dir.c started to use macros from
> libc-internal.h but didn't include it, causing build issues.
>
> 2016-02-22  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
>
> 	* posix/tst-dir.c: Include libc-internal.h.

I have never seen a need to include <libc-internal.h> like this
before.  How are you building the tests that you need this?

Thanks,
Florian
Tulio Magno Quites Machado Filho Feb. 22, 2016, 2:31 p.m. UTC | #2
Florian Weimer <fw@deneb.enyo.de> writes:

> * Tulio Magno Quites Machado Filho:
>
>> A recent change to posix/tst-dir.c started to use macros from
>> libc-internal.h but didn't include it, causing build issues.
>>
>> 2016-02-22  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
>>
>> 	* posix/tst-dir.c: Include libc-internal.h.
>
> I have never seen a need to include <libc-internal.h> like this
> before.  How are you building the tests that you need this?

There is nothing special:
configure --prefix=/usr --with-cpu=power8 --enable-add-ons
make
make -k check

I'm using GCC 4.8.4.

It seems we already have some testcases doing that:
$ find . -type f \( -name 'test-*' -o -name 'tst-*' -o -name 'bug*' \) \
  | xargs grep -n libc-internal.h
./stdio-common/tst-printfsz.c:5:#include <libc-internal.h>
./stdio-common/tst-unlockedio.c:23:#include <libc-internal.h>
./stdio-common/test-vfprintf.c:28:#include <libc-internal.h>
./stdio-common/tst-sprintf.c:5:#include <libc-internal.h>
./stdio-common/bug21.c:2:#include <libc-internal.h>
./stdio-common/tst-printf.c:29:#include <libc-internal.h>
./string/tst-endian.c:6:#include <libc-internal.h>
./misc/tst-error1.c:6:#include <libc-internal.h>
Florian Weimer Feb. 22, 2016, 3:23 p.m. UTC | #3
* Tulio Magno Quites Machado Filho:

> Florian Weimer <fw@deneb.enyo.de> writes:
>
>> * Tulio Magno Quites Machado Filho:
>>
>>> A recent change to posix/tst-dir.c started to use macros from
>>> libc-internal.h but didn't include it, causing build issues.
>>>
>>> 2016-02-22  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
>>>
>>> 	* posix/tst-dir.c: Include libc-internal.h.
>>
>> I have never seen a need to include <libc-internal.h> like this
>> before.  How are you building the tests that you need this?
>
> There is nothing special:
> configure --prefix=/usr --with-cpu=power8 --enable-add-ons
> make
> make -k check
>
> I'm using GCC 4.8.4.

Thanks, found the difference, it's due to the #includes in
sysdeps/i386/nptl/tls.h and sysdeps/x86_64/nptl/tls.h.  Perhaps we can
get rid of that to avoid future such breakage.

Patch is fine.
Tulio Magno Quites Machado Filho Feb. 22, 2016, 4:40 p.m. UTC | #4
Florian Weimer <fw@deneb.enyo.de> writes:

> Thanks, found the difference, it's due to the #includes in
> sysdeps/i386/nptl/tls.h and sysdeps/x86_64/nptl/tls.h.  Perhaps we can
> get rid of that to avoid future such breakage.
>
> Patch is fine.

I just noticed Stefan sent another patch before me:
http://patchwork.sourceware.org/patch/10980/

Stefan, feel free to push it.  ;-)
diff mbox

Patch

diff --git a/posix/tst-dir.c b/posix/tst-dir.c
index d0e4878..4b15f34 100644
--- a/posix/tst-dir.c
+++ b/posix/tst-dir.c
@@ -26,6 +26,7 @@ 
 #include <string.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <libc-internal.h>
 
 
 /* We expect four arguments: