Bug 493941

Summary: glibc: getline from stdio.h declared by default
Product: [Fedora] Fedora Reporter: Scott Tsai <scottt.tw>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: jakub, me
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-03 11:55:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Scott Tsai 2009-04-03 11:47:31 UTC
Description of problem:
'make headers_install' in linux-2.6.27.6 fails because the function 'getline' from stdio.h is exposed without the user having to declare any extra feature test macros.

Version-Release number of selected component (if applicable):
glibc-headers-2.9.90-12.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Download and extract linux-2.6.27.6.tar.bz2
2. cd linux-2.6.27.6
3. make headers_install
  
Actual results:
linux-2.6.27.6]$ make headers_install
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  HOSTCC  scripts/basic/fixdep
scripts/basic/fixdep.c: In function ‘traps’:
scripts/basic/fixdep.c:377: warning: dereferencing type-punned pointer will break strict-aliasing rules
scripts/basic/fixdep.c:379: warning: dereferencing type-punned pointer will break strict-aliasing rules
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/unifdef
scripts/unifdef.c:209: error: conflicting types for ‘getline’
/usr/include/stdio.h:653: note: previous declaration of ‘getline’ was here
make[1]: *** [scripts/unifdef] Error 1
make: *** [__headers] Error 2


Expected results:
'make headers_install' succeeds.

Additional info:
'getline' is a common function name. My uneducated guess is that we don't want __USE_XOPEN2K8 to be true without the user defining an extra feature test macro?

Comment 1 Jakub Jelinek 2009-04-03 11:55:12 UTC
This has been already fixed in newer kernels.
getline is a standard POSIX 2008 function and we do want POSIX C 2008 stuff by default.  If you don't like it, choose a different namespace or rename your functions.

Comment 2 Jason D. Clinton 2009-04-14 02:52:04 UTC
Just an FYI, this change also broke GNUChess which is no longer maintained upstream.