bug-gnulib
[Top][All Lists]
Advanced

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

Re: gets() issue


From: Eric Blake
Subject: Re: gets() issue
Date: Mon, 19 Nov 2012 15:08:16 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121029 Thunderbird/16.0.2

On 11/18/2012 04:03 PM, Ivan Burbakov wrote:
> Building of some packages (inetutils, namely) with glibc-2.16 tends to
> fail because this line:
> 
> /* It is very rare that the developer ever has full control of stdin,
>    so any use of gets warrants an unconditional warning; besides, C11
>    removed it.  */
> #undef gets
> #if HAVE_RAW_DECL_GETS

HAVE_RAW_DECL_GETS should only be non-zero if gets() is declared...

> _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
> #endif
> 
> Error message is "./stdio.h:1030:1: error: 'gets' undeclared here (not
> in a function)"

...but this says gets is undeclared.  Are you sure you don't have a
stale config.cache lying around from pre-glibc 2.16 days, where the
cache has old information impacting your build?  Other than that, I'd
have to see your config.log to see why HAVE_RAW_DECL_GETS is getting set
to non-zero when it is clearly undeclared.

> 
> There is full logs: https://gist.github.com/4107950

These logs don't include the full config.log.  Also, just looking at the
captured stdout of configure, I don't see any line that states:

checking whether gets is declared without a macro... XXX

I would expect that line to exist, with a resounding 'no' under modern
glibc (and a 'yes' in C99), according to the code that would normally
set HAVE_RAW_DECL_GETS.

-- 
Eric Blake   address@hidden    +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]