Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Fix configure test build errors with clang-15



On Fri, Sep 16, 2022 at 12:30 AM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Wed, Sep 14, 2022 at 7:42 PM Nicholas Vinson <nvinson234@xxxxxxxxx> wrote:
> >
> > When building with clang-15.0.0, I discovered several configure tests
> > incorrectly fail because clang-15.0.0 errors with messages similar to:
> >
> >     "error: type specifier missing, defaults to 'int'"
>
> For zsh-workers -- do we need to worry that these changed declarations
> themselves need to be conditionalized somehow, that is, are other
> compilers going to fail because of "int main()" when they expect "void
> main()"?

"void main()" has been invalid C and "int main()" valid C since the
very first standard. There are no C compilers that reject the latter.

Note that this patch is replacing "main()" (no type specifier at all)
with "int main()". The new code will work everywhere.

Roman.




Messages sorted by: Reverse Date, Date, Thread, Author