[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: malloca.c non-top variable declaration
From: |
Simon Josefsson |
Subject: |
Re: malloca.c non-top variable declaration |
Date: |
Wed, 11 Sep 2024 10:38:12 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Bruno Haible <bruno@clisp.org> writes:
> This is an instance of "declaration after statement", which is a feature of
> C99,
> which Gnulib routinely assumes nowadays. We document this since 2017-04-24
> [1].
>
> I hope you aren't using -Werror, right?
>
> Does the compilation error go away if you add the 'c99' module to your
> package's
> Gnulib imports?
>
> If not, can you look into the documentation of that platform's compiler and
> find
> compiler flags that turn on maximum C99 compatibility, and make things work
> with this?
>
> If not, what platform is this?
I have been able to reproduce the problem on Debian 3.0 Woody, it uses
gcc 2.95. There is no -Werror in use and the c99 module doesn't help
(or does it have to be configured somehow?). I've added Debian 3.0 to
libidn's GitLab CI/CD to help test things for old targets like this.
I think gnulib doesn't really support gcc 2.95, but for bootstrapping
reasons I think it do make sense to support some ancient distribution
and make things work on it. Perhaps leaving the patch in the mailing
list archive is sufficient, for others to integrate in their project if
they care. Eventually we could have some ./bootstrap --c89 flag to
automatically patch gnulib source code for concerns like this? I
understand the desire to not be limited by C89 in the canonical source
code in gnulib. Patches like this could be carried in the official
gnulib git repository too, maintained on a voluntary basis for people
who care about C89 compatibility.
Successful build (with local gnulib patch for malloca.c):
https://gitlab.com/jas/libidn/-/jobs/7795378107
Failing build:
https://gitlab.com/jas/libidn/-/jobs/7795723369
/Simon
signature.asc
Description: PGP signature