Front page | perl.perl5.porters |
Postings from June 2021
From: Nicholas Clark
June 11, 2021 16:46
Message ID: 20210611164640.GH16703@etla.org
On Thu, May 20, 2021 at 02:19:01AM +0100, Dagfinn Ilmari Mannsåker wrote:
> Nicholas Clark <email@example.com> writes:
> > On Wed, May 19, 2021 at 07:21:04PM +0200, Tomasz Konojacki wrote:
> >> I think not only we shouldn't use them, but also we should explictly ban
> >> them with something like "-Wvla -Werror=vla".
> > Yes, I think that this is a good idea. I'm not going to look into it
> > right now, but I will try to remember to, and figure out what to probe
> > for, and where in our setup.
> > (Unless anyone else wants to beat me to it.)
commit 7886147fdc48d029686af31c71c808adad1a5737 (HEAD -> blead, origin/blead, origin/HEAD)
Author: Nicholas Clark <firstname.lastname@example.org>
Date: Fri Jun 11 12:17:44 2021 +0000
Add -Werror=vla by default. C99 variable-length arrays are dangerous.
C11 makes them optional, and MSVC doesn't support them. We can't use them
(but even if we could, we should not).
diff --git a/cflags.SH b/cflags.SH
index 96bfcd928b..162538583d 100755
@@ -180,6 +180,7 @@ Intel*) ;; # # Is that you, Intel C++?
*) warns="-std=c89 -ansi $pedantic \
+ -Werror=vla \
-Wextra -W \
# declaration after statement is normal in C++ rather than an
I wasn't even trying to win.
(Also tested on on gcc 4.6.1 on AIX, which happens to have -Werror=vla
How old a gcc would I need to find to *not* have it?)