dsully / perl-crypt-openssl-x509

Perl interface to OpenSSL's X509 module.
Other
25 stars 33 forks source link

initialize 'ret' and 'key' to some value... #1

Closed nrh closed 13 years ago

nrh commented 13 years ago

cpanm/CPAN.pm try to compile X509.c with -Wall -Werror and fail due to these being able to be used without initialization, so we're just going to initialize them to sane values.

it might be useful for 'ret' to be initialized to 1 rather than 0? I'm not sure if that would be more sane or not.

here are the build failures I get under osx/10.6.5:

[nrh@plotz  X509.xsc && mv X509.xsc X509.c
/usr/bin/gcc-4.2 -c  -I/usr/include/openssl -I/usr/local/include/ssl -I/usr/local/ssl/include -O2 -arch x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/opt/local/include -g -Wall -Werror   -DVERSION=\"1.5\" -DXS_VERSION=\"1.5\"  "-I/opt/local/lib/perl5/5.10.1/darwin-2level/CORE"   X509.c
cc1: warnings being treated as errors
X509.c: In function ‘XS_Crypt__OpenSSL__X509__Extension_basicC’:
X509.xs:825: warning: ‘ret’ may be used uninitialized in this function
X509.xs:825: note: ‘ret’ was declared here
make: *** [X509.o] Error 1
[nrh@plotz  X509.xsc && mv X509.xsc X509.c
/usr/bin/gcc-4.2 -c  -I/usr/include/openssl -I/usr/local/include/ssl -I/usr/local/ssl/include -O2 -arch x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/opt/local/include -g -Wall -Werror   -DVERSION=\"1.5\" -DXS_VERSION=\"1.5\"  "-I/opt/local/lib/perl5/5.10.1/darwin-2level/CORE"   X509.c
cc1: warnings being treated as errors
X509.c: In function ‘XS_Crypt__OpenSSL__X509_extensions’:
X509.xs:172: warning: ‘key’ may be used uninitialized in this function
X509.xs:172: note: ‘key’ was declared here
make: *** [X509.o] Error 1
dsully commented 13 years ago

Thanks - applied!