public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/28613] New: error: array subscript 19 is outside array bounds of ‘void [136]’ [-Werror=array-bounds]
@ 2021-11-22  9:45 mliska at suse dot cz
  2021-11-22  9:48 ` [Bug build/28613] " mliska at suse dot cz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mliska at suse dot cz @ 2021-11-22  9:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28613

            Bug ID: 28613
           Summary: error: array subscript 19 is outside array bounds of
                    ‘void [136]’ [-Werror=array-bounds]
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: mliska at suse dot cz
  Target Milestone: ---

I noticed the current GCC master (12) emits the following werror:

g++ -x c++    -I. -I../../gdb -I../../gdb/config
-DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H
-I../../gdb/../include/opcode -I../../gdb/../readline/readline/..
-I../../gdb/../zlib -I../bfd -I../../gdb/../bfd -I../../gdb/../include
-I../libdecnumber -I../../gdb/../libdecnumber  -I../../gdb/../gnulib/import
-I../gnulib/import -I../../gdb/.. -I.. -I../../gdb/../libbacktrace/
-I../libbacktrace/  -DTUI=1   -I/usr/include/guile/3.0 -I/usr   -I../../gdb/..
-pthread  -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-variable
-Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body
-Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare
-Wno-error=maybe-uninitialized -Wno-mismatched-tags -Wsuggest-override
-Wimplicit-fallthrough=3 -Wduplicated-cond -Wshadow=local -Wdeprecated-copy
-Wdeprecated-copy-dtor -Wredundant-move -Wmissing-declarations
-Wstrict-null-sentinel -Wformat -Wformat-nonliteral -Werror -g -O2     -c -o
language.o -MT language.o -MMD -MP -MF ./.deps/language.Tpo
../../gdb/language.c
In file included from /home/marxin/bin/gcc/include/c++/12.0.0/functional:64,
                 from ../../gdb/../gdbsupport/ptid.h:35,
                 from ../../gdb/../gdbsupport/common-defs.h:198,
                 from ../../gdb/defs.h:28,
                 from ../../gdb/language.c:31:
In function ‘void std::__final_insertion_sort(_RandomAccessIterator,
_RandomAccessIterator, _Compare) [with _RandomAccessIterator = const char**;
_Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const char*, const
char*)>]’,
    inlined from ‘void std::__sort(_RandomAccessIterator,
_RandomAccessIterator, _Compare) [with _RandomAccessIterator = const char**;
_Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const char*, const
char*)>]’ at /home/marxin/bin/gcc/include/c++/12.0.0/bits/stl_algo.h:1940:31,
    inlined from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter =
const char**; _Compare = bool (*)(const char*, const char*)]’ at
/home/marxin/bin/gcc/include/c++/12.0.0/bits/stl_algo.h:4853:18,
    inlined from ‘void add_set_language_command()’ at
../../gdb/language.c:492:13,
    inlined from ‘void _initialize_language()’ at ../../gdb/language.c:1175:28:
/home/marxin/bin/gcc/include/c++/12.0.0/bits/stl_algo.h:1849:32: error: array
subscript 19 is outside array bounds of ‘void [136]’ [-Werror=array-bounds]
 1849 |           std::__insertion_sort(__first, __first + int(_S_threshold),
__comp);
      |          
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘void add_set_language_command()’,
    inlined from ‘void _initialize_language()’ at ../../gdb/language.c:1175:28:
../../gdb/language.c:474:78: note: at offset 152 into object of size 136
allocated by ‘operator new []’
  474 |   language_names = new const char *[ARRAY_SIZE
(language_defn::languages) + 2];
      |                                                                        
     ^
cc1plus: all warnings being treated as errors
make: *** [Makefile:1655: language.o] Error 1
make: Target 'all' not remade because of errors.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-23  8:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22  9:45 [Bug build/28613] New: error: array subscript 19 is outside array bounds of ‘void [136]’ [-Werror=array-bounds] mliska at suse dot cz
2021-11-22  9:48 ` [Bug build/28613] " mliska at suse dot cz
2021-11-22 16:15 ` msebor at gmail dot com
2021-11-23  8:43 ` mliska at suse dot cz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).