[v2] Use gcc -finput-charset=ascii for check-installed-headers.

Message ID 20200213093438.52242-1-stli@linux.ibm.com
State Committed
Headers

Commit Message

Stefan Liebler Feb. 13, 2020, 9:34 a.m. UTC
  A non-ascii character in the installed headers leads now to:
error: failure to convert ascii to UTF-8

Such a finding in s390 specific fenv.h leads to fails in GCC testsuite.
See glibc commit 08aea89ef67c5780ae734073494df0a451bce20f.

Adding this gcc option also to our tests was proposed by Florian Weimer.

This change also found a hit in resource.h where now "microseconds" is used.
I've adjusted all the resource.h files.

I've used the following command to check for further hits in headers.
LC_ALL=C find -name "*.h" -exec grep -PHn "[\x80-\xFF]" {} \;

Tested on s390x and x86_64.
---
 scripts/check-installed-headers.sh            | 3 ++-
 sysdeps/unix/sysv/linux/alpha/bits/resource.h | 2 +-
 sysdeps/unix/sysv/linux/bits/resource.h       | 2 +-
 sysdeps/unix/sysv/linux/mips/bits/resource.h  | 2 +-
 sysdeps/unix/sysv/linux/sparc/bits/resource.h | 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)
  

Comments

Stefan Liebler Feb. 13, 2020, 9:40 a.m. UTC | #1
On 2/13/20 10:34 AM, Stefan Liebler wrote:
> A non-ascii character in the installed headers leads now to:
> error: failure to convert ascii to UTF-8
> 
> Such a finding in s390 specific fenv.h leads to fails in GCC testsuite.
> See glibc commit 08aea89ef67c5780ae734073494df0a451bce20f.
> 
> Adding this gcc option also to our tests was proposed by Florian Weimer.
> 
> This change also found a hit in resource.h where now "microseconds" is used.
> I've adjusted all the resource.h files.
> 
> I've used the following command to check for further hits in headers.
> LC_ALL=C find -name "*.h" -exec grep -PHn "[\x80-\xFF]" {} \;
> 
> Tested on s390x and x86_64.
> ---

Compared to v1, this patch just uses "microseconds" instead of "us" as 
suggested by Zack Weinberg 
(https://www.sourceware.org/ml/libc-alpha/2020-02/msg00510.html).

Zack, can you please have a final look before I commit the patch.

Bye,
Stefan
  
Zack Weinberg Feb. 13, 2020, 11:56 a.m. UTC | #2
On Thu, Feb 13, 2020 at 4:41 AM Stefan Liebler <stli@linux.ibm.com> wrote:
> On 2/13/20 10:34 AM, Stefan Liebler wrote:
> > A non-ascii character in the installed headers leads now to:
> > error: failure to convert ascii to UTF-8
> >
> > Such a finding in s390 specific fenv.h leads to fails in GCC testsuite.
> > See glibc commit 08aea89ef67c5780ae734073494df0a451bce20f.
> >
> > Adding this gcc option also to our tests was proposed by Florian Weimer.
> >
> > This change also found a hit in resource.h where now "microseconds" is used.
> > I've adjusted all the resource.h files.
> >
> > I've used the following command to check for further hits in headers.
> > LC_ALL=C find -name "*.h" -exec grep -PHn "[\x80-\xFF]" {} \;
> >
> > Tested on s390x and x86_64.
> > ---
>
> Compared to v1, this patch just uses "microseconds" instead of "us" as
> suggested by Zack Weinberg
> (https://www.sourceware.org/ml/libc-alpha/2020-02/msg00510.html).
>
> Zack, can you please have a final look before I commit the patch.

Looks good, please commit.

Reviewed-by: Zack Weinberg <zackw@panix.com>

zw
  
Stefan Liebler Feb. 13, 2020, 4:33 p.m. UTC | #3
On 2/13/20 12:56 PM, Zack Weinberg wrote:
> On Thu, Feb 13, 2020 at 4:41 AM Stefan Liebler <stli@linux.ibm.com> wrote:
>> On 2/13/20 10:34 AM, Stefan Liebler wrote:
>>> A non-ascii character in the installed headers leads now to:
>>> error: failure to convert ascii to UTF-8
>>>
>>> Such a finding in s390 specific fenv.h leads to fails in GCC testsuite.
>>> See glibc commit 08aea89ef67c5780ae734073494df0a451bce20f.
>>>
>>> Adding this gcc option also to our tests was proposed by Florian Weimer.
>>>
>>> This change also found a hit in resource.h where now "microseconds" is used.
>>> I've adjusted all the resource.h files.
>>>
>>> I've used the following command to check for further hits in headers.
>>> LC_ALL=C find -name "*.h" -exec grep -PHn "[\x80-\xFF]" {} \;
>>>
>>> Tested on s390x and x86_64.
>>> ---
>>
>> Compared to v1, this patch just uses "microseconds" instead of "us" as
>> suggested by Zack Weinberg
>> (https://www.sourceware.org/ml/libc-alpha/2020-02/msg00510.html).
>>
>> Zack, can you please have a final look before I commit the patch.
> 
> Looks good, please commit.
> 
> Reviewed-by: Zack Weinberg <zackw@panix.com>
> 
> zw
> 
Committed.

Thanks,
Stefan
  

Patch

diff --git a/scripts/check-installed-headers.sh b/scripts/check-installed-headers.sh
index 0ed572ce0d..f70340f098 100644
--- a/scripts/check-installed-headers.sh
+++ b/scripts/check-installed-headers.sh
@@ -123,7 +123,8 @@  $expanded_lib_mode
 #include <$header>
 int avoid_empty_translation_unit;
 EOF
-            if $cc_cmd -fsyntax-only $lang_mode "$cih_test_c" 2>&1
+            if $cc_cmd -finput-charset=ascii -fsyntax-only $lang_mode \
+		       "$cih_test_c" 2>&1
             then :
             else failed=1
             fi
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/resource.h b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
index 7210bc7ea3..8b80906f27 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
@@ -98,7 +98,7 @@  enum __rlimit_resource
   __RLIMIT_RTPRIO = 14,
 #define RLIMIT_RTPRIO __RLIMIT_RTPRIO
 
-  /* Maximum CPU time in µs that a process scheduled under a real-time
+  /* Maximum CPU time in microseconds that a process scheduled under a real-time
      scheduling policy may consume without making a blocking system
      call before being forcibly descheduled.  */
   __RLIMIT_RTTIME = 15,
diff --git a/sysdeps/unix/sysv/linux/bits/resource.h b/sysdeps/unix/sysv/linux/bits/resource.h
index 3cc3eedcc3..8745234ed9 100644
--- a/sysdeps/unix/sysv/linux/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/bits/resource.h
@@ -98,7 +98,7 @@  enum __rlimit_resource
   __RLIMIT_RTPRIO = 14,
 #define RLIMIT_RTPRIO __RLIMIT_RTPRIO
 
-  /* Maximum CPU time in µs that a process scheduled under a real-time
+  /* Maximum CPU time in microseconds that a process scheduled under a real-time
      scheduling policy may consume without making a blocking system
      call before being forcibly descheduled.  */
   __RLIMIT_RTTIME = 15,
diff --git a/sysdeps/unix/sysv/linux/mips/bits/resource.h b/sysdeps/unix/sysv/linux/mips/bits/resource.h
index f423ff8fc2..4600d08ade 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/resource.h
@@ -98,7 +98,7 @@  enum __rlimit_resource
   __RLIMIT_RTPRIO = 14,
 #define RLIMIT_RTPRIO __RLIMIT_RTPRIO
 
-  /* Maximum CPU time in µs that a process scheduled under a real-time
+  /* Maximum CPU time in microseconds that a process scheduled under a real-time
      scheduling policy may consume without making a blocking system
      call before being forcibly descheduled.  */
   __RLIMIT_RTTIME = 15,
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/resource.h b/sysdeps/unix/sysv/linux/sparc/bits/resource.h
index 714f30fd73..5d5762fab0 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/resource.h
@@ -98,7 +98,7 @@  enum __rlimit_resource
   __RLIMIT_RTPRIO = 14,
 #define RLIMIT_RTPRIO __RLIMIT_RTPRIO
 
-  /* Maximum CPU time in µs that a process scheduled under a real-time
+  /* Maximum CPU time in microseconds that a process scheduled under a real-time
      scheduling policy may consume without making a blocking system
      call before being forcibly descheduled.  */
   __RLIMIT_RTTIME = 15,