bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] stdio: Don't redefine gets when using C++


From: Eric Blake
Subject: Re: [PATCH] stdio: Don't redefine gets when using C++
Date: Fri, 05 Jun 2015 10:21:44 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 06/04/2015 05:10 AM, Jonathan Perkin wrote:
> We've hit this failure a few times in pkgsrc with packages which embed gnulib,
> an example being the latest gnutls:
> 
>   ../../src/gl/stdio.h:1034:1: error: 'char* gets(char*)' conflicts with a 
> previous declaration
>    _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
>    ^
> 
>   
> /opt/tools/gcc49/lib/gcc/x86_64-sun-solaris2.11/4.9.2/include-fixed/iso/stdio_iso.h:259:14:
>  note: previous declaration 'char* std::gets(char*)'
>    extern char *gets(char *);
>                 ^

Uggh, so it is complaining about namespace issues.  There may be a more
elegant way to keep the warning on C++ (because you absolutely should
not use std::gets() there, any more than gets() in C); but Bruno is the
one that wrote all the magic for dealing with C++ namespaces, and I
don't know how to tackle it.

So I'm applying your patch, with a slight reduction in #if by
consolidating lines.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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