On Monday 12 February 2007 00:47, Andreas Metzler 
<[EMAIL PROTECTED]> wrote:
> after adding #include <stdlib.h> the example complains without
> warnings (except for the missing return/exit in main()) as C instead
> of C++ code:

warn.c:6: warning: missing initializer
warn.c:6: warning: (near initialization for ‘gcry_threads_pthread.read’)

Strange, when renaming to .c and compiling with
"gcc -lgnutls -W -lpthread gnutlstest.c" I get the above warning.

> [EMAIL PROTECTED]:/tmp$ gcc -Wall -lgnutls -lpthread -o gnutlstest
> gnutlstest.c gnutlstest.c: In function ‘main’:
> gnutlstest.c:16: warning: control reaches end of non-void function
> [EMAIL PROTECTED]:/tmp$

What version of gcc are you using?  I'm using the following:
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

In any case one of the benefits of C++ over C is that more warnings are 
produced and therefore more bugs are discovered.  When library code gives 
warnings then the actions taken to turn off such warnings will also result in 
bugs in application code not being discovered.

Incidentally /usr/share/doc/gnutls-doc/html/gnutls.html also needs to be 
updated to reference stdlib.h.

Reply via email to