Mailing List Archive

C99 compatibility fixes for gnupg 1
Is gnupg 1 still being maintained? The configure script needs a few
changes to avoid behavioral changes once compilers no longer support
implicit function declarations by default.

Related to:

<https://fedoraproject.org/wiki/Changes/PortingToModernC>
<https://fedoraproject.org/wiki/Toolchain/PortingToModernC>

Thanks,
Florian
Re: C99 compatibility fixes for gnupg 1 [ In reply to ]
On Fri, 27 Jan 2023 13:11, Florian Weimer said:
> Is gnupg 1 still being maintained? The configure script needs a few

Yes, because it is required to decrypt old mails.

> changes to avoid behavioral changes once compilers no longer support
> implicit function declarations by default.

I know a couple of folks who won't cheer a move t such modern compilers.
After all it makes a lot of autoconf tests superfluous. But as along as
it is only about prototypes we can easily apply this patch. GnuPG has
always demanded C89.


Shalom-Salam,

Werner


--
The pioneers of a warless world are the youth that
refuse military service. - A. Einstein
Re: C99 compatibility fixes for gnupg 1 [ In reply to ]
Hi!

I applied the patch. However, changing main to void without having a
return statement is also prone to errors or warnings, right?


Salam-Shalom,

Werner


--
The pioneers of a warless world are the youth that
refuse military service. - A. Einstein
Re: C99 compatibility fixes for gnupg 1 [ In reply to ]
* Werner Koch:

> I applied the patch. However, changing main to void without having a
> return statement is also prone to errors or warnings, right?

I think reaching the } of main has always been specified to return 0
(except for free-standing environments where main isn't special, but
this doesn't apply here).

And the return type of main does not change whether it is declared
explicitly or not.

Thanks,
Florian


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: C99 compatibility fixes for gnupg 1 [ In reply to ]
* Florian Weimer, 2023-01-30 17:18:
>* Werner Koch:
>
>>I applied the patch. However, changing main to void without having a
>>return statement is also prone to errors or warnings, right?
>
>I think reaching the } of main has always been specified to return 0

Only since C99. It wasn't like that in C89:

"Reaching the } that terminates a function is equivalent to executing a
return statement without an expression."

"If the main function executes a return that specifies no value, the
termination status returned to the host environment is undefined."

--
Jakub Wilk

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-devel