Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#778 closed defect (fixed)

silence clang array bounds warnings

Reported by: Jim Ursetto Owned by:
Priority: minor Milestone: 4.9.0
Component: compiler Version: 4.7.x
Keywords: clang c99 Cc:
Estimated difficulty:


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.

Attachments (1)

0001-Use-flexible-array-member-in-C99-mode-silences-clang.patch (706 bytes) - added by Jim Ursetto 13 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 12 years ago by Jim Ursetto

Resolution: fixed
Status: newclosed

comment:2 Changed 12 years ago by felix winkelmann


Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.