Bug 493941 - glibc: getline from stdio.h declared by default
Summary: glibc: getline from stdio.h declared by default
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-03 11:47 UTC by Scott Tsai
Modified: 2009-04-14 02:52 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-03 11:55:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.