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

Andreas Metzler ametzler at downhill.at.eu.org
Sun Feb 11 14:47:20 CET 2007


On 2007-02-05 Russell Coker <russell at coker.com.au> wrote:
> Package: libgnutls-dev
> Version: 1.4.4-3
> Severity: normal

> #include <gnutls/gnutls.h>
> #include <gcrypt.h>
> #include <errno.h>
> #include <pthread.h>
> GCRY_THREAD_OPTION_PTHREAD_IMPL;

> int main()
> {
>   /* The order matters.
>    */
>   gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
>   gnutls_global_init();
> }

> The above is from /usr/share/doc/gnutls-doc/html/gnutls.html.  I compile it
> with the following command and get warnings as below:

> gcc test.cpp -lstdc++ -lgnutls -W -lpthread
> test.cpp:9: warning: missing initializer for member ‘gcry_thread_cbs::read’
> test.cpp:9: warning: missing initializer for member ‘gcry_thread_cbs::write’
> test.cpp:9: warning: missing initializer for member ‘gcry_thread_cbs::select’
> test.cpp:9: warning: missing initializer for member ‘gcry_thread_cbs::waitpid’

> The GCRY_THREAD_OPTION_PTHREAD_IMPL macro doesn't initialise all members of
> gcry_thread_cbs.  I believe that the sample code should compile with no
> warnings and that the fields in question should be initialised to NULL or
> a reduced structure that lacks those fields should be used.

Hello,
after adding #include <stdlib.h> the example complains without
warnings (except for the missing return/exit in main()) as C instead
of C++ code:

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$

cu andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'




More information about the Pkg-gnutls-maint mailing list