diff options
author | David Edelsohn <dje.gcc@gmail.com> | 2021-01-19 22:24:08 -0500 |
---|---|---|
committer | David Edelsohn <dje.gcc@gmail.com> | 2021-01-20 17:42:02 -0500 |
commit | fb39c4fe445beab2e2bf9402a8ccb3c541f2aa5c (patch) | |
tree | 2d7fc45e1f48f02cbf00a8091319551e82704d4c /gcc/fortran/resolve.c | |
parent | 842afc4e289ed3fe69583672c1a180f268d73799 (diff) | |
download | gcc-fb39c4fe445beab2e2bf9402a8ccb3c541f2aa5c.zip gcc-fb39c4fe445beab2e2bf9402a8ccb3c541f2aa5c.tar.gz gcc-fb39c4fe445beab2e2bf9402a8ccb3c541f2aa5c.tar.bz2 |
aix: make ctype_inline.h thread-safe and avoid _OBJ_DATA char subscript.
g++.dg/warn/Wstringop-overflow-6.C tests for a bogus overflow warning in
system headers. This testcase was generating a -Wchar-subscript warning
on AIX because ctype_inline.h was subscripting AIX _OBJ_DATA using a char.
The _M_table case cast the subscript to unsigned char, but the _OBJ_DATA
case did not.
The investigation also exposed that AIX has added a thread-safe variant
of access to __lc_type that had not been applied to the libstdc++
implementation.
This patch casts the subscript to unsigned char and adds the THREAD_SAFE
variant. libstdc++ always is compiled with pthreads, but it is good
to make the situation explicit and to document the appropriate usage.
Bootstrapped on powerpc-ibm-aix7.2.3.0.
libstdc++-v3/ChangeLog:
* config/os/aix/ctype_inline.h (bool ctype<char>:: is): Cast
_OBJ_DATA subscript to unsigned char. Add _THREAD_SAFE access to
__lc_type.
(const char* ctype<char>:: is): Same.
Diffstat (limited to 'gcc/fortran/resolve.c')
0 files changed, 0 insertions, 0 deletions