bug-texinfo
[Top][All Lists]
Advanced

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

Re: fun with c23


From: Gavin Smith
Subject: Re: fun with c23
Date: Fri, 9 Aug 2024 10:23:53 +0100

On Thu, Aug 08, 2024 at 11:36:18PM -0600, Jeffrey Cliff wrote:
> tl;dr c23 changes break compilation. 2 small patches
> 
> [Firstly: apologize if this went to the wrong list - according to my
> (terrible) email provider it didn't go out.  Hopefully this is the
> correct list]

Yes, it's the correct list.

> Looks like at least two kinds of changes to C coming with C23 (ie
> compiling with -std=gnu2x / gnu23), both involving changes to the
> arguments of functions and how explicit you have to be about them.
> And when I compile with -std=gnu23 (ie compile to the C23 standard) it
> means 2 compilation problems result:
> 
> 1)
> * whereas before it was OK to define strerror without being explicit
> about its argument,
> it seems to depend on an int being provided as an argument
> 
> /usr/include/string.h
>   419 | extern char *strerror (int __errnum) __THROW;
>       |              ^~~~~~~~
> 
> (man 3 strerror seems to agree: it should have an argument
> 
> char *strerror(int errnum);
> 
> so when ./system.h attempts to define it
> 
> #ifndef HAVE_DECL_STRERROR
> extern char *strerror ();
> #endif
> 
> for some reason two things go wrong
> i) gcc doesn't seem to define HAVE_DECL_STRERROR leading to ( ???
> google is telling me nothing about how this is supposed to be defined
> )
> ii) an attempt made to define it externally with the wrong definition

This has already been removed on the "master" branch:

2024-06-16  Patrice Dumas  <pertusus@free.fr>

        * system.h: remove strerror definition, the prototype looks wrong and
        the conditional is not set anywhere.

> 2) because there's a *whole bunch* of functions declared as VFunctions
> with various kinds of arguments (for example cmd in echo-area.c and
> m-x.c 's command-func)

There has already been some reduction in the use of VFunction on the
"master" branch.  Now it is only used in terminal.c.  It should be
straightforward to declare the types of the function parameters for
the remaining use.

We could also try to make similar changes on the release/7.1 branch
for a bug-fix release.



reply via email to

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