You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Nicolas C (JIRA)" <ji...@apache.org> on 2013/07/12 14:57:48 UTC

[jira] [Commented] (AMQCPP-439) Compilation error - activemq-cpp library 3.4.1 - invalid conversion from "const unsigned char**" to "unsigned char**"

    [ https://issues.apache.org/jira/browse/AMQCPP-439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13706909#comment-13706909 ] 

Nicolas C commented on AMQCPP-439:
----------------------------------

Good syntax for const_cast is the following one :

STACK_OF(CONF_VALUE)* confValue =
                method->i2v( method, method->it ?
                             ASN1_item_d2i(NULL, const_cast<unsigned char **>(&data), extension->value->length, ASN1_ITEM_ptr(method->it)) :
                             method->d2i( NULL, const_cast<unsigned char **>(&data), extension->value->length ), NULL );

Patching this is mandatory in my case ( cannot upgrade easily compiler version because I part of of hudge project )
Moreover, compiler is right, passing a variable declared as const in a non-const param of a method is bad.  Perhaps depending of compiler version, it's an error or a warning, but It's better to tell him explicitly that we know that we do this (well I suppose, we know :) ) 
                
> Compilation error - activemq-cpp library 3.4.1 - invalid conversion from "const unsigned char**" to "unsigned char**"
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQCPP-439
>                 URL: https://issues.apache.org/jira/browse/AMQCPP-439
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 3.4.1
>         Environment: OS: RedHat AS 4.0 Update7 32 bit.
> Software:
> activemq-cpp-library-3.4.1
> gcc 3.4.6
> GNU Make 3.80
> libtool  1.5.26 
> automake  1.10.1
> autoconf 2.69
> apr 1.4.6
> apr-util 1.5.1
> m4 1.4.16
> openssl 1.0.0g
>            Reporter: Suresh Velupula
>            Assignee: Timothy Bish
>            Priority: Critical
>
> Compilation error while building activemq-cpp-library 3.4.1. 
> [activemq-cpp-library-3.4.1]# make
> make  all-recursive
> make[1]: Entering directory `/suresh/activemq-cpp-library-3.4.1'
> Making all in src/main
> make[2]: Entering directory `/suresh/activemq-cpp-library-3.4.1/src/main'
> /bin/sh ../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..    -ansi -pedantic   -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE  -I/usr/local/suresh/include/apr-1   -I/usr/local/suresh/include/apr-1  -I/usr/kerberos/include   -W -Wall -Wextra -Wconversion -fPIC -fstrict-aliasing -Wstrict-aliasing=2 -Wno-long-long -g -O2 -pthread -MT decaf/internal/net/ssl/openssl/libactivemq_cpp_la-OpenSSLSocket.lo -MD -MP -MF decaf/internal/net/ssl/openssl/.deps/libactivemq_cpp_la-OpenSSLSocket.Tpo -c -o decaf/internal/net/ssl/openssl/libactivemq_cpp_la-OpenSSLSocket.lo `test -f 'decaf/internal/net/ssl/openssl/OpenSSLSocket.cpp' || echo './'`decaf/internal/net/ssl/openssl/OpenSSLSocket.cpp
>  g++ -DHAVE_CONFIG_H -I. -I../.. -ansi -pedantic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/local/suresh/include/apr-1 -I/usr/local/suresh/include/apr-1 -I/usr/kerberos/include -W -Wall -Wextra -Wconversion -fPIC -fstrict-aliasing -Wstrict-aliasing=2 -Wno-long-long -g -O2 -pthread -MT decaf/internal/net/ssl/openssl/libactivemq_cpp_la-OpenSSLSocket.lo -MD -MP -MF decaf/internal/net/ssl/openssl/.deps/libactivemq_cpp_la-OpenSSLSocket.Tpo -c decaf/internal/net/ssl/openssl/OpenSSLSocket.cpp  -fPIC -DPIC -o decaf/internal/net/ssl/openssl/.libs/libactivemq_cpp_la-OpenSSLSocket.o
> decaf/internal/net/ssl/openssl/OpenSSLSocket.cpp: In member function `void decaf::internal::net::ssl::openssl::OpenSSLSocket::verifyServerCert(const std::string&)':
> decaf/internal/net/ssl/openssl/OpenSSLSocket.cpp:679: error: invalid conversion from `const unsigned char**' to `unsigned char**'
> decaf/internal/net/ssl/openssl/OpenSSLSocket.cpp:680: error: invalid conversion from `const unsigned char**' to `unsigned char**'
> make[2]: *** [decaf/internal/net/ssl/openssl/libactivemq_cpp_la-OpenSSLSocket.lo] Error 1
> make[2]: Leaving directory `/suresh/activemq-cpp-library-3.4.1/src/main'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/suresh/activemq-cpp-library-3.4.1'
> make: *** [all] Error 2

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira