[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH 0/1] Fix spurious array bounds warnings on
From: |
Kooda |
Subject: |
Re: [Chicken-hackers] [PATCH 0/1] Fix spurious array bounds warnings on OpenBSD |
Date: |
Sat, 21 Jan 2017 15:01:37 +0100 |
On Thu, 19 Jan 2017 22:20:11 +1300
Evan Hanson <address@hidden> wrote:
> Hi folks,
>
> Here's a fix for #1107 that avoids futzing with feature macros or
> standards flags while still dispelling the warnings on OpenBSD. It
> just bumps the size of the C_block_item struct's data field from the
> smallest possible value (1) to the largest possible value (INT_MAX).
> This doesn't actually change CHICKEN's behaviour since that value is
> unused -- it's just a hack to declare what is really a flexible array
> member in C99 -- but it will increase the array size that the
> compiler uses for bounds analysis and as a result it will stop the
> unnecessary warnings.
>
> I propose this as a solution rather than introducing "-std=c99" or
> some other such flag since CHICKEN doesn't currently require a C99
> compiler and I'd prefer not to give up our C89 compatibility.
>
> Let me know what you think,
>
> Evan
>
Sounds fine by me, I just hope that nobody does strange stuff with
C_SCHEME_BLOCK in eggs.
I tried this patch on master on OpenBSD 6, and it errors out directly
with this message:
chicken.h:773: error: size of array 'data' is too large