Project

General

Profile

Bug #6173

GCC12: error: array subscript 1 is outside array bounds

Added by Dirk Diggler about 1 month ago. Updated 24 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2022-05-27
Due date:
% Done:

0%

Estimated time:
Found in version:
latest snapshot
Affected Versions:

Description

See: https://aur.archlinux.org/packages/tvheadend-git

In file included from src/tcp.c:32:
In function 'ip_check_is_any_v6',
inlined from 'ip_check_is_any' at src/tcp.h:109:46,
inlined from 'ip_check_is_local_address' at src/tcp.c:89:17:
src/tcp.h:104:57: error: array subscript 1 is outside array bounds of 'const struct sockaddr_storage0' [-Werror=array-bounds]
104 | { return ((uint64_t *)IP_AS_V6(address, addr).s6_addr)[0] == ((uint64_t *)(&in6addr_any.s6_addr))[0] && | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/tcp.h: In function 'ip_check_is_local_address':
src/tcp.h:107:19: note: at offset 8 into object 'address' of size 8
107 | static inline int ip_check_is_any(const struct sockaddr_storage *address) | ^~~~~~~~~~~~~
In function 'ip_check_is_any_v6',
inlined from 'ip_check_is_any' at src/tcp.h:109:46,
inlined from 'ip_check_is_local_address' at src/tcp.c:89:17:
src/tcp.h:105:57: error: array subscript 2 is outside array bounds of 'const struct sockaddr_storage0' [-Werror=array-bounds]
105 | ((uint64_t *)IP_AS_V6(address, addr).s6_addr)[1] == ((uint64_t *)(&in6addr_any.s6_addr))[1]; } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/tcp.h: In function 'ip_check_is_local_address':
src/tcp.h:107:19: note: at offset 16 into object 'address' of size 8
107 | static inline int ip_check_is_any(const struct sockaddr_storage *address) | ^~~~~~~~~~~~~
In function 'ip_check_equal_v6',
inlined from 'ip_check_equal' at src/tcp.h:78:42,
inlined from 'ip_check_is_local_address' at src/tcp.c:96:26:
src/tcp.h:71:53: error: array subscript 1 is outside array bounds of 'const struct sockaddr_storage0' [-Werror=array-bounds]
71 | { return ((uint64_t *)IP_AS_V6(a, addr).s6_addr)[0] == ((uint64_t *)IP_AS_V6(b, addr).s6_addr)[0] && | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/tcp.h: In function 'ip_check_is_local_address':
src/tcp.h:74:19: note: at offset 8 into object 'a' of size 8
74 | static inline int ip_check_equal | ^~~~~~~~~~~~
In function 'ip_check_equal_v6',
inlined from 'ip_check_equal' at src/tcp.h:78:42,
inlined from 'ip_check_is_local_address' at src/tcp.c:96:26:
src/tcp.h:71:99: error: array subscript 1 is outside array bounds of 'const struct sockaddr_storage0' [-Werror=array-bounds]
71 | { return ((uint64_t *)IP_AS_V6(a, addr).s6_addr)[0] == ((uint64_t *)IP_AS_V6(b, addr).s6_addr)[0] && | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/tcp.h: In function 'ip_check_is_local_address':
src/tcp.h:74:19: note: at offset 8 into object 'b' of size 8
74 | static inline int ip_check_equal | ^~~~~~~~~~~~
In function 'ip_check_equal_v6',
inlined from 'ip_check_equal' at src/tcp.h:78:42,
inlined from 'ip_check_is_local_address' at src/tcp.c:96:26:
src/tcp.h:72:53: error: array subscript 2 is outside array bounds of 'const struct sockaddr_storage0' [-Werror=array-bounds]
72 | ((uint64_t *)IP_AS_V6(a, addr).s6_addr)[1] == ((uint64_t *)IP_AS_V6(b, addr).s6_addr)[1]; } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/tcp.h: In function 'ip_check_is_local_address':
src/tcp.h:74:19: note: at offset 16 into object 'a' of size 8
74 | static inline int ip_check_equal | ^~~~~~~~~~~~
In function 'ip_check_equal_v6',
inlined from 'ip_check_equal' at src/tcp.h:78:42,
inlined from 'ip_check_is_local_address' at src/tcp.c:96:26:
src/tcp.h:72:99: error: array subscript 2 is outside array bounds of 'const struct sockaddr_storage0' [-Werror=array-bounds]
72 | ((uint64_t *)IP_AS_V6(a, addr).s6_addr)[1] == ((uint64_t *)IP_AS_V6(b, addr).s6_addr)[1]; } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/tcp.h: In function 'ip_check_is_local_address':
src/tcp.h:74:19: note: at offset 16 into object 'b' of size 8
74 | static inline int ip_check_equal

History

#1

Updated by Flole Systems about 1 month ago

  • Status changed from New to Invalid

You're using an unofficial/modified build. Contact the maintainer for support.

#2

Updated by Dirk Diggler about 1 month ago

Flole Systems wrote:

You're using an unofficial/modified build. Contact the maintainer for support.

Hey, not so fast. I get the same error when compiling the current github source!

#3

Updated by Flole Systems about 1 month ago

Then feel free to update this so it's a proper bug report (including which OS and compiler is used and steps to reproduce) then it can be re-opened, but don't expect anyone to work on it as it's building perfectly fine on 24 different systems. If you provide a PR though it will be reviewed and merged eventually.

#4

Updated by Dirk Diggler about 1 month ago

Operating System: Arch Linux
Kernel: Linux 5.17.9-arch1-1
Architecture: x86-64

gcc (GCC) 12.1.0

Steps: ./configure, make

#5

Updated by Dirk Diggler about 1 month ago

Hey, compiler version was a good hint. I installed older GCC 11 version, which works.
So i don't know if tvheadend code has to be fixed for GCC 12?

#6

Updated by Flole Systems about 1 month ago

  • Subject changed from error: array subscript 1 is outside array bounds to GCC12: error: array subscript 1 is outside array bounds
  • Status changed from Invalid to New
#7

Updated by Pim Zandbergen 24 days ago

Fedora 36 switched to GCC 12 too.

Also available in: Atom PDF