help-gsasl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] Fix compilation problems associated with -Wunused-result


From: Brad Hards
Subject: Re: [PATCH 1/3] Fix compilation problems associated with -Wunused-result and -Werror
Date: Mon, 30 May 2011 13:37:20 +1000
User-agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.5.5; x86_64; ; )

On Mon, 30 May 2011 01:13:13 pm Glenn Maynard wrote:
> (I'm not sure why this is on help-gsasl, but since I'm reading it...)
Couldn't find the -devel channel.

> On Sun, May 29, 2011 at 10:40 PM, Brad Hards <address@hidden> wrote:
> > diff --git a/examples/client-callback.c b/examples/client-callback.c
> > index ee014f7..4925802 100644
> > --- a/examples/client-callback.c
> > +++ b/examples/client-callback.c
> > @@ -36,8 +36,11 @@ client_authenticate (Gsasl_session * session)
> > 
> >   do
> >     {
> > +      char *res;
> >       printf ("Input base64 encoded data from server:\n");
> > -      fgets (buf, sizeof (buf) - 1, stdin);
> > +      res = fgets (buf, sizeof (buf) - 1, stdin);
> > +      if (res == NULL)
> > +        buf[0] = '\0';
> >       if (buf[strlen (buf) - 1] == '\n')
> >         buf[strlen (buf) - 1] = '\0';
> 
> Example code typically has minimal error checking, to focus on the
> topic of the example.
I agree, but example code should compile, and with a current git checkout and 
a current ubuntu (11.04) gcc configuration, it won't (because of -Werror)

Its the lesser of two bad options.

Brad



reply via email to

[Prev in Thread] Current Thread [Next in Thread]