OpenSSL version: 0.9.7a (RedHat Fedora, 7.3 and others).
>From what I can see relevant code is identical in 0.9.7d.

Compiler: RedHat GCC 2.96-113, 3.3.3-3

Serverity: Minor

Problem:

gcc -Wstrict-protoctpes barfs on PEM_write_SSL_SESSION() and other
similarily constructed OpenSSL macros with "warning: function declaration
isn't a prototype"

The warning comes from the "(int (*)())" typecast within the macro:

#define PEM_write_SSL_SESSION(fp,x) \
        PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \
                PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL)

Just deleting the typecast makes GCC happy.

Tried a number of different variants on the typecasts, but could not 
really find a suitable one GCC accepted. Typecasting of function pointers 
is a nasty bussiness.

The same construct is used in a wide variety OpenSSL macros, and I have a
feeling that the typecast can/should be deleted from all of them.

Note: If it is the case that there is some other odd compiler actually
requiring this dummy typecast then leave it as it is. I don't want you to
break other compilers only to get rid of this GCC warning as it is no more 
than a warning..

Patch: (removes whole class of typecasts from the headers)

   perl -i -p -e 's%\((char|int) ?\*?\(\*\)\(\)\)%%' include/openssl/*.h

Regards
Henrik Nordstr�m

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to