On Wed, 15 Jan 2025, David Malcolm wrote: > Here's an updated version of the patch > > OK to push? (we could tweak it in followups)
This will need updating to work together with Jakub's patch that also adds the C section to changes.html. > +<h4 id="c23-fn-decls-without-parameters">Function declarations without > parameters</h4> > +<p> > + The meaning of function declarations of the form > + <code>rettype identifier ();</code> > + such as > + <code>char *strstr ();</code> > + that are not a definition changed in C23. > +</p> It's not limited to "not a definition", it also introduces a prototype (for calls following the definition) for () in a definition as well, where there wasn't one before. > +<p> > + Code relying on a non-zero number of parameters (such as a single > + <code>int</code>) can be fixed for C23 by adding the correct parameters > + to the function declarator, such as in the above via: > +</p> > +<pre><code> > + void (*handler)(int); > +</code></pre> > +<p> > + or you can use <a > href="https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-std-1">-std=</a> > + to select an earlier version of the C standard. > +</p> Maybe also mention the case where the function already has a prototype in some header (standard or in the project) and you can just remove the non-prototype declaration and make sure to include the header? This is for legacy code that does things like void *malloc(); with its own declarations of standard functions, you may have a better idea of how common that is. -- Joseph S. Myers josmy...@redhat.com