[Patch] configure tests return instead of exit
Darren Tucker
dtucker at zip.com.au
Mon Aug 5 18:43:20 EST 2002
Tim Rice wrote:
[about OpenSSL configure test]
On the subject of configure.ac, while R'ing the FM for autoconf I
noticed the following at
http://www.gnu.org/manual/autoconf/html_node/Guidelines.html:
"Test programs should exit, not return, from main, because on some
systems (old Suns, at least) the argument to return in main is ignored."
Is there a reason some tests use return in configure.ac? If not, the
attached patch changes them.
--
Darren Tucker (dtucker at zip.com.au)
GPG Fingerprint D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /cvs/openssh/configure.ac,v
retrieving revision 1.84
diff -u -r1.84 configure.ac
--- configure.ac 23 Jul 2002 00:00:06 -0000 1.84
+++ configure.ac 5 Aug 2002 08:29:54 -0000
@@ -487,7 +487,7 @@
[
#include <sys/types.h>
#include <dirent.h>
-int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
+int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
],
[AC_MSG_RESULT(yes)],
[
@@ -518,7 +518,7 @@
[
#include <stdio.h>
#include <skey.h>
-int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
+int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
],
[AC_MSG_RESULT(yes)],
[
@@ -658,7 +658,7 @@
AC_TRY_RUN(
[
#include <stdio.h>
-int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
+int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
],
[AC_MSG_RESULT(yes)],
[
@@ -771,7 +771,7 @@
[
#include <string.h>
#include <openssl/opensslv.h>
-int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
+int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
],
[
AC_MSG_RESULT(yes)
@@ -797,7 +797,7 @@
[
#include <string.h>
#include <openssl/rand.h>
-int main(void) { return(RAND_status() == 1 ? 0 : 1); }
+int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
],
[
OPENSSL_SEEDS_ITSELF=yes
More information about the openssh-unix-dev
mailing list