Summary
silence clang array bounds warnings
Metadata
- Id: ac758b384fd4455a7dfa620e8159a3edfa9eb380
- Trac id: 778
- Type: defect
- Reporter: zbigniew
- Owner:
- Cc:
- Status: closed
- Component: compiler
- Estimated difficulty:
- Resolution: fixed
- Priority: minor
- Milestone: 4.9.0
- Version: 4.7.x
- Changetime: 2012-09-24 21:47:48 UTC
- Created: 2012-01-16 07:22:29 UTC
- Keywords: clang c99
Attachments
- ac758b384fd4455a7dfa620e8159a3edfa9eb380/attachments/0001-Use-flexible-array-member-in-C99-mode-silences-clang.patch
Description
There is a data[[|1 ]] declaration in C_block_struct, which is needed for a variable length structure in C89. However, in clang this produces a ton of warnings unless you silence them with -Wno-array-bounds.
Solution: if C99 mode is detected--the default in clang--use a flexible array member instead. This is the portable way to do it for C99 compilers, and as a benefit, shuts clang up.
If you don't have to clang to test, you can use gcc with --std=c99 or --std=gnu99 to activate the code path.
Changes and comments
[2012-01-16 07:23:48 UTC] zbigniew attached 0001-Use-flexible-array-member-in-C99-mode-silences-clang.patch (description=#f)
[2012-01-27 18:03:25 UTC] zbigniew changed status from new to closed
[2012-01-27 18:03:25 UTC] zbigniew set resolution to fixed
[2012-09-24 21:47:48 UTC] felix changed milestone from 4.8.0 to 4.9.0
[2012-09-24 21:47:48 UTC] felix wrote:
Milestone 4.8.0 deleted