bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ISO C99 mixed declaration and statements


From: Gavin Smith
Subject: Re: ISO C99 mixed declaration and statements
Date: Fri, 18 Aug 2023 15:02:12 +0100

On Fri, Aug 18, 2023 at 03:04:28PM +0200, Bruno Haible wrote:
> Hi Gavin,
> 
> I see this commit:
>       * install-info/install-info.c (output_dirfile): Avoid mixed
>       declaration and statements.
> 
> Is it possible nowadays to assume ISO C99 mixed declaration and statements
> are supported by the C compiler? I don't know about the portability targets
> of TeXinfo, but for those of Gnulib, documented in [1], we can now make
> this assumption [2].

It may have been some MS-Windows compiler (MSVC?) that didn't support it,
but I don't know the history behind this.  I haven't been aware of any
problems with mixed declarations and statements.  I remember they've gone
unnoticed for a while before being fixed, and nobody's complained.

Indeed, I expect that there are other constructs that are also invalid C89,
in particular non-constant initialisers that are used quite a lot, e.g.

  char *text1 = (*entry1)->text;

I am going to take out the recommendation that we check for this with
compiler warnings as this would simplify things.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]