C99 compatibility fixes for gnupg 1

Jakub Wilk jwilk at jwilk.net
Mon Jan 30 17:45:52 CET 2023


* 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



More information about the Gnupg-devel mailing list