[Pkg-gnutls-maint] Bug#409778: libgnutls-dev: warnings when compiling sample Posix threading codes

Russell Coker russell at coker.com.au
Sun Feb 11 22:49:58 CET 2007


On Monday 12 February 2007 00:47, Andreas Metzler 
<ametzler at downhill.at.eu.org> 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.

> ametzler at argenau:/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
> ametzler at argenau:/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.




More information about the Pkg-gnutls-maint mailing list