So how does exit() work?

If I use exit(), GCC doesn’t give a warning:

int main()
{
exit(EXIT_SUCCESS);
}
If we use any other function, we will definitely meet such a warning:

warning: control reaches end of non-void …

Exit a Script On Error

I’m building a Shell Script that has a if function like this one:

if jarsigner -verbose -keystore $keyst -keystore $pass $jar_file $kalias
then
echo $jar_file signed sucessfully
else
echo …