[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] stdio: Don't redefine gets when using C++
From: |
Jonathan Perkin |
Subject: |
[PATCH] stdio: Don't redefine gets when using C++ |
Date: |
Thu, 4 Jun 2015 12:10:34 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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 *);
^
Full build log is here:
http://us-east.manta.joyent.com/pkgsrc/public/reports/upstream-trunk32/20150602.2233/gnutls-3.3.15/build.log
We've fixed it a few different ways over time:
https://github.com/joyent/pkgsrc/blob/joyent/release/2015Q1/devel/m4/patches/patch-lib_stdio.in.h
https://github.com/joyent/pkgsrc/blob/joyent/release/2015Q1/math/octave/patches/patch-libgnu_stdio.in.h
https://github.com/joyent/pkgsrc/blob/joyent/release/2015Q1/security/gnutls/patches/patch-gl_stdio.in.h
but the cleanest fix appears to be the last, so I am proposing it here for
inclusion upstream.
Regards,
--
Jonathan Perkin - Joyent, Inc. - www.joyent.com
gnulib_stdio_gets.diff
Description: Text document
- [PATCH] stdio: Don't redefine gets when using C++,
Jonathan Perkin <=