[gnutls-help] gnutls-3.2.13 : another code bug "base64.c", line 99: error: void function cannot return value

Nikos Mavrogiannopoulos nmav at gnutls.org
Wed Apr 30 19:40:38 CEST 2014

On Wed, 2014-04-30 at 12:50 -0400, dev wrote:
> On April 30, 2014 at 4:06 AM Nikos Mavrogiannopoulos <nmav at gnutls.org>
> wrote:
> > On Wed, Apr 30, 2014 at 12:24 AM, dev <dev at cor0.com> wrote:
> > > I just checked and sure enough the code is trying to
> > > return a value from a static void function :
> > [...]
> > > That right there is just plain wrong.
> > > How can you return a value from a void function ?
> >
> > I believe that comes from c++, no idea if it is in the c99 standard,
> > but work with gcc and clang.
> >
> > > Does this stuff compile with GCC and it seems to work ?
> >
> > Apparently yes. I'll modify the code to keep your compiler happy as
> > well.
> patch? 

It is on the repository.

> The problem is not "my compiler" but "the code" wherein there are
> returns
> for void functions.  That is just wrong on all compilers.  The fact
> that
> this somehow slides past GCC makes me question GCC even more.

and is that syntax forbidden by C99? Most major compilers support that
syntax due to C++, so it may simply be a limitation of the solaris

> Perhaps now is a good time to try some pedantic flags on GCC and find
> possibly hidden bugs that may be all over the place and you just
> are not seeing them.  Better yet, some test platforms are needed on some
> OS's like Solaris, AIX, HPUX, OpenBSD perhaps.

Feel free to test it and provide patches for the various platforms you
tested it on.

> Regardless, getting this gnuTLS code to compile on a commercial UNIX
> like Solaris is a major incredible pain.

That's because it is not developed on these platforms. You are welcome
to provide patches to ease compilation to your favorite platform. gnutls
is developed on Linux systems with gcc and that's not going to change;
any other platforms are supported due to people contributing patches.


More information about the Gnutls-help mailing list