Bug 17723

Summary: crypt.h and unistd.h have conflicting function declarations
Product: [Retired] Red Hat Linux Reporter: roystgnr
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-09-23 04:28:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description roystgnr 2000-09-19 20:14:50 UTC
Using:
glibc-devel-2.1.92-5
gcc-c++-2.96-46

I am unable to compile the administrative tools from the KDE 1.94 beta
release, as certain source files in that release (e.g. kuser/pwddlg.cpp)
include both unistd.h and crypt.h.  Compiling these files with g++ gives
the following errors:

g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/usr/lib/qt2/include
-I/usr/X11R6/include  -I.. -I../kuser  -DNDEBUG  -D_KU_SHADOW -D_KU_QUOTA
-DQUOTACTL_IN_LIBC -D_KU_DEBUG -D_SVID_SOURCE -D_GNU_SOURCE -frtti
-DNO_DEBUG  -c pwddlg.cpp

In file included from pwddlg.cpp:9:
/usr/include/crypt.h:33: declaration of `char *crypt (const char *, 
const char *)' throws different exceptions
/usr/include/unistd.h:953: than previous declaration `char *crypt 
(const char *, const char *) throw ()'
/usr/include/crypt.h:36: declaration of `void setkey (const char *)' 
throws different exceptions
/usr/include/unistd.h:956: than previous declaration `void setkey 
(const char *) throw ()'
/usr/include/crypt.h:40: declaration of `void encrypt(char *, int)' 
throws different exceptions
/usr/include/unistd.h:960: than previous declaration `void encrypt 
(char *, int) throw ()'


The bug is reproducable; the minimum reproduction seems to be:

g++ -I/usr/include -D_GNU_SOURCE hello.cpp

Where hello.cpp is:

#include <crypt.h>
#include <unistd.h>
int main(void) { return 0; }

Comment 1 Jakub Jelinek 2000-09-23 04:28:27 UTC
Thanks for bug report, fixed in sources CVS, will come out in the
upcoming glibc errata.