]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
On some systems (NetBSD 1.6 and Solaris 9, at least), GCC doesn't understand
authorBen Harris <bjh21@bjh21.me.uk>
Sun, 24 Apr 2005 14:43:00 +0000 (14:43 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 24 Apr 2005 14:43:00 +0000 (14:43 +0000)
the semantics of assert(0) and believes it can return.  Add a gratuitous
exit(1) to convince it that this won't happen, and hence quell a couple of
warnings about variables' being used uninitialised.

[originally from svn r5669]

import.c
unix/uxnet.c

index 25012d289822d6ec324b9cabe2d2aac13818d1bf..2e2c12fb55705401cc4d57c64f92753cdfc5a860 100644 (file)
--- a/import.c
+++ b/import.c
@@ -766,6 +766,7 @@ int openssh_write(const Filename *filename, struct ssh2_userkey *key,
         footer = "-----END DSA PRIVATE KEY-----\n";
     } else {
         assert(0);                     /* zoinks! */
+       exit(1); /* XXX: GCC doesn't understand assert() on some systems. */
     }
 
     /*
@@ -1497,6 +1498,7 @@ int sshcom_write(const Filename *filename, struct ssh2_userkey *key,
        type = "dl-modp{sign{dsa-nist-sha1},dh{plain}}";
     } else {
         assert(0);                     /* zoinks! */
+       exit(1); /* XXX: GCC doesn't understand assert() on some systems. */
     }
 
     /*
index 46959e2f7824fa9704b7d549808849b119831277..31b12921d733f9fcc0f0fb2815aed1508c46db98 100644 (file)
@@ -576,6 +576,7 @@ static int try_connect(Actual_Socket sock)
 
       default:
        assert(0 && "unknown address family");
+       exit(1); /* XXX: GCC doesn't understand assert() on some systems. */
     }
 
     fl = fcntl(s, F_GETFL);