Re: ptype of prototype of a funtion

murugesan
2004-03-18T04:46:36Z

After realising the prototype I am passing the correct parameter but it
produces warning

Here goes my script

# cat dinesh
Script started on Thu Mar 18 10:58:12 2004

# gcc -g test.c /home/dinesh/openssl-0.9.7c/libcrypto.sl.0.9.7
/home/dinesh/openssl-0.9.7c/libssl.sl.0.9.7
test.c: In function `main':
test.c:10: warning: passing arg 3 of `PEM_read_bio_PKCS8_PRIV_KEY_INFO' from
incompatible pointer type

# gdb -q a.out
(gdb) break main
Breakpoint 1 at 0x2800: file test.c, line 9.
(gdb) r
Starting program: /home/dinesh/openssl_test/a.out

Breakpoint 1, main () at test.c:9
9 bp=BIO_new_file(PATH"/pkcs8","r");
(gdb) n
10 PEM_read_bio_PKCS8_PRIV_KEY_INFO(bp,&pkcs8,&num, "test");
(gdb) ptype PEM_read_bio_PKCS8_PRIV_KEY_INFO
type = struct pkcs8_priv_key_info_st {
int broken;
struct asn1_string_st *version;
struct X509_algor_st *pkeyalg;
struct asn1_type_st *pkey;
struct stack_st *attributes;
} *(struct bio_st *, struct pkcs8_priv_key_info_st **, int *, signed char *)
(gdb) q
The program is running. Exit anyway? (y or n) y

# cat test.c
#include <openssl/pem.h>
#define PATH "./my_temp"
main()
{
BIO *bp;
FILE *fp;
PKCS8_PRIV_KEY_INFO *pkcs8;
int num;
PEM_read_bio_PKCS8_PRIV_KEY_INFO(bp,&pkcs8,&num, "test");
}
#

script done on Thu Mar 18 10:58:52 2004

// For simplicity the program has been reduced ( parameters has not been
initialized )

Regards,
Murugesan

============================================================================
=======================
----- Original Message -----
From: murugesan
To: Ramana Radhakrishnan
Cc: gdb@sources.redhat.com
Sent: Wednesday, March 17, 2004 11:28 AM
Subject: Re: ptype of prototype of a funtion

Cool!! This is working

I have been using the one which has not been built with debug option.
I have the 2 OpenSSL 1 being built with debug option ( in different dir
) and the other without debug option ( in default location )

Thanks Ramana & Elizabeth for reminding me.

Regards,
Murugesan.