Bug 207963

Summary: errors in header and out dated manpage
Product: [Fedora] Fedora Reporter: Francois Charles Matthieu BERENGER <francois.berenger>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 5   
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: 2006-09-26 18:40:44 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 Francois Charles Matthieu BERENGER 2006-09-25 15:50:16 UTC
Description of problem:
in files from glibc-headers-2.4-4:
#define __USE_GNU
#include <stdio.h>
shows compilation errors in stdio.h
(/usr/include/stdio.h:288: error: expected declaration specifiers
or ‘...’ before ‘_IO_cookie_io_functions_t’)

Not related, the man page says (man hsearch)
#define _GNU_SOURCE 
#include <search.h> 
in order to enable
int hcreate_r(size_t nel, struct hsearch_data *tab); 
int hsearch_r(ENTRY item, ACTION action, ENTRY **ret, struct hsearch_data *tab); 
void hdestroy_r(struct hsearch_data *tab);

Having a look at search.h, I see you need #define __USE_GNU
and not #define _GNU_SOURCE

Version-Release number of selected component (if applicable):
glibc-headers-2.4-4

How reproducible:
compile a C source file with the given includes and #define directives

Steps to Reproduce:
1. edit
2. compile
3.

Actual results:
compiler warning, outdated man page

Expected results:
no warning, up to date man page

Additional info:
I hope I was complete enough, good luck. :-)

Comment 1 Jakub Jelinek 2006-09-26 18:40:44 UTC
You should never define __USE_GNU, that's glibc internal macro.
_GNU_SOURCE is one of the feature test macros, see
info libc 'Feature Test Macros'
which should be defined via -D_GNU_SOURCE on compiler's command line or
via #define _GNU_SOURCE before inclusion of the first header in the source.
glibc headers then do the right thing (see /usr/include/features.h for the
details).