Subject: Re: gcc with openssl on Solaris and NetBSD complains about prototypes
To: None <pkgsrc-users@netbsd.org>
From: Klaus Heinz <k.heinz.maer.sechs@onlinehome.de>
List: pkgsrc-users
Date: 03/11/2006 19:33:52
Wolfgang Solfrank wrote:

> From man gcc:
> 
> -Wsystem-headers
>      Print warning messages for constructs found in system header files.
>      Warnings from system headers are normally suppressed, on the
>      assumption that they usually do not indicate real problems and
>      would only make the compiler output harder to read.  Using this
>      command line option tells GCC to emit warnings from system headers
>      as if they occurred in user code.
>      ...

Very interesting.

  $ gcc -E -c foo.c > native-headers.c
  $ gcc -I. -E -c foo.c > local-headers.c
  $ grep -v -e '^#' native-headers.c > native-headers2.c
  $ grep -v -e '^#' local-headers.c > local-headers2.c
  $ diff local-headers2.c native-headers2.c

  $ gcc -Werror -Wstrict-prototypes  -c native-headers.c -o foo.o
  $ gcc -Werror -Wstrict-prototypes  -c native-headers2.c -o foo.o
  native-headers2.c:726: warning: function declaration isn't a prototype
  
As soon as I strip the pre-processed file from all the information cpp
adds both files are identical and generate the same warning.

Turning off the suppression of warnings with -Wsystem-headers does not
work for me (NetBSD 3.0), I cannot get gcc to show the warning with the
native include files.


Searching some more, this non-compliance with ANSI seems to be a
recurring problem with OpenSSL but it should be fixed with openssl-0.9.8a:

  int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f)(void));


ciao
     Klaus