develooper Front page | perl.perl5.porters | Postings from June 2021

Re: C99

Thread Previous | Thread Next
From:
Eric Herman
Date:
June 15, 2021 12:20
Subject:
Re: C99
Message ID:
CAE3QHe=9SF3XgLxcFCQtUDkGSjFTWqZKP4uYDDpJ5PYZ3mEkbw@mail.gmail.com
I agree 100% that variable-length arrays are risky.

Sadly, it should be noted that this perfectly safe construction:

    const size_t buf_size = 40;
    char buf[buf_size];

is caught as an error by -Werror=vla

On Mon, 14 Jun 2021 at 01:27, Yuki Kimoto <kimoto.yuki@gmail.com> wrote:

>
>
> 2021-6-12 1:47 Nicholas Clark <nick@ccl4.org> wrote:
>
>>
>>     Add -Werror=vla by default. C99 variable-length arrays are dangerous.
>>
>>
> I feel this is good because I feel risky and unstable about
> variable-length arrays.
>
>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About