On 11/08/2015 05:37 AM, tosif tamboli via RT wrote:
> Hi ,
> I am compiling crypto in openssl for vxWorks version 5.4
> with 5.5.1 it compiles well
> But with 5.4 it gives error for below files
> bn_depr.c
> ccppc: Internal compiler error: program cc1 got fatal signal 6
>
> When checked it gives error for location
> static void *dummy=&dummy;
> When I comment it then compiles well. but not getting why it's required if
> it's not being used anywhere.
>
> Can you please provide your inputs for above?
>

It is present so that when OPENSSL_NO_DEPRECATED is set, pedantic
compilers do not warn about an empty compilation unit.  However, it does
not conform to the current best practice for such code.  The attached
patch should help.

-Ben

commit 51aafdce95f998190f91581fa5abf149edcb9c9b
Author: Benjamin Kaduk <[email protected]>
Date:   Mon Nov 9 11:04:35 2015 -0600

    Move dummy variable under appropriate conditional
    
    static void *dummy = &dummy;
    is needed only when OPENSSL_NO_DEPRECATED and PEDANTIC are both set.

diff --git a/crypto/bn/bn_depr.c b/crypto/bn/bn_depr.c
index 34895f5..5932fdd 100644
--- a/crypto/bn/bn_depr.c
+++ b/crypto/bn/bn_depr.c
@@ -64,8 +64,6 @@
 #include "bn_lcl.h"
 #include <openssl/rand.h>
 
-static void *dummy = &dummy;
-
 #ifndef OPENSSL_NO_DEPRECATED
 BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
                           const BIGNUM *add, const BIGNUM *rem,
@@ -112,4 +110,8 @@ int BN_is_prime_fasttest(const BIGNUM *a, int checks,
     return BN_is_prime_fasttest_ex(a, checks, ctx_passed,
                                    do_trial_division, &cb);
 }
+#else /* OPENSSL_NO_DEPRECATED */
+# ifdef PEDANTIC
+static void *dummy = &dummy;
+# endif
 #endif
_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

Reply via email to