Bug 251665

Summary: New open(2) magic breaks php build
Product: [Fedora] Fedora Reporter: Hans de Goede <hdegoede>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: jorton
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: 2007-08-10 12:16:58 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 Hans de Goede 2007-08-10 10:43:30 UTC
Description of problem:
I just update glibc and now when compiling php5 I get:
/home/hans/projects/fedora-extras/php/devel/php-5.2.3/ext/dba/dba.c: In function
'php_dba_open':
/home/hans/projects/fedora-extras/php/devel/php-5.2.3/ext/dba/dba.c:933: error:
expected identifier before '(' token

Before the glibc update it compiled fine, line 933 is:
        if (error || hptr->open(info, &error TSRMLS_CC) != SUCCESS) {

Adding "#undef open" after the #include statements fixes this. Am I the only one
who things making open a macro is a bad idea? There are bound to be many pieces
of software with structs, with in the struct a function pointer called open.

Comment 1 Jakub Jelinek 2007-08-10 12:16:58 UTC
You can and should use (hptr->open)(info, &error TSRMLS_CC)
or hptr->(open)(info, &error TSRMLS_CC)
POSIX allows any standard function to be defined function-like macro and
in the case of open the reason why we changed it were multiple requests from
security folks - way too many packages aren't able to use open correctly
with O_CREAT and pass random flags as third argument, which often is a security
issue.

Comment 2 Joe Orton 2007-08-10 12:30:28 UTC
Hans, I've added the patch to fix this to the devel branch.