RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 736451 - gcc drops inline function incorrectly with "-std=c99"
Summary: gcc drops inline function incorrectly with "-std=c99"
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: gcc
Version: 6.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-07 17:37 UTC by Kirby Zhou
Modified: 2011-09-07 18:04 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-07 18:04:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Kirby Zhou 2011-09-07 17:37:52 UTC
Description of problem:

A simple C program can not be compiled by gcc with "-std=c99"

Version-Release number of selected component (if applicable):

gcc-4.4.5-6.el6.x86_64
gcc-4.6.0-10.fc15.x86_64

How reproducible:

100%


Steps to Reproduce:

[root@djt-17-109-v06 tmp]# cat c99bug.c 
#include <stdio.h>

struct dummy;

inline int 
__foo(struct dummy *disk)
{
        printf("dummy\n");
        return -1;
}

static struct dummy *
foo_wrapper(const char *device)
{
        struct dummy* disk = (struct dummy*)device;
        __foo(disk);
        return NULL;
}

int
main(int argc, char *argv[])
{
        foo_wrapper("");
        return 0;
}

[root@djt-17-109-v06 tmp]# gcc -std=c99 c99bug.c 
/tmp/ccGNGqb6.o: In function `foo_wrapper':
c99bug.c:(.text+0x1c): undefined reference to `__foo'
collect2: ld returned 1 exit status

 
Actual results:


Expected results:

compile the simple demo code successfully.

Additional info:

The following gcc do not have this bug.

gcc-4.1.2-51.el5
gcc44-4.4.4-13.el5

Comment 2 Jakub Jelinek 2011-09-07 18:04:33 UTC
That is not a bug, it is what ISO C99 requires.  It is incompatible with the GNU inline extension behavior, and starting with GCC 4.3 -std=c99 or -std=gnu99 enables the ISO C99 mandated semantics.  You can use -fgnu89-inline command line option to force the GNU inline semantics, or you can use __attribute__((gnu_inline)) on functions that should have the GNU inline semantics.


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