This service will be undergoing non-disruptive maintenance at 07:20 UTC, 2018-12-14. It is expected to last approximately 30 minutes
Bug 127606 - __builtin_expect's prototype does not expect int args; assert feeds it just that
Summary: __builtin_expect's prototype does not expect int args; assert feeds it just that
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
(Show other bugs)
Version: 2
Hardware: x86_64 Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-07-10 19:53 UTC by D. Hugh Redelmeier
Modified: 2007-11-30 22:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-04 07:42:44 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2004:586 normal SHIPPED_LIVE Low: glibc security update 2004-12-20 05:00:00 UTC

Description D. Hugh Redelmeier 2004-07-10 19:53:59 UTC
Description of problem:
gcc -Wconversion will always complain about invocations of the assert
macro.  Apparently a boolean expression (i.e. of type int) is not
accepted by __builtin_expect, which is called by the assert macro.

Version-Release number of selected component (if applicable):
gcc-3.3.3-7 (for AMD 64)


How reproducible:
Always.

Steps to Reproduce:
1.
cat >t.c <<\EOF
#include <assert.h>

int
main()
{
    assert(1);
    assert(1L);
    assert(1LL);
    assert(&main);
    return 0;
}
EOF
2.gcc -Wconversion t.c

  
Actual results:
t.c: In function `main':
t.c:6: warning: passing arg 1 of `__builtin_expect' with different
width due to prototype
t.c:6: warning: passing arg 2 of `__builtin_expect' with different
width due to prototype
t.c:7: warning: passing arg 1 of `__builtin_expect' with different
width due to prototype
t.c:7: warning: passing arg 2 of `__builtin_expect' with different
width due to prototype
t.c:8: warning: passing arg 1 of `__builtin_expect' with different
width due to prototype
t.c:8: warning: passing arg 2 of `__builtin_expect' with different
width due to prototype
t.c:9: warning: passing arg 1 of `__builtin_expect' with different
width due to prototype
t.c:9: warning: passing arg 2 of `__builtin_expect' with different
width due to pro

Expected results:
[silence, certainly for line 6, but probably for the others as well]

Additional info:

After preprocessing, the first assert becomes:
    ((void) (__builtin_expect (!!(1), 1) ? 0 : (__assert_fail ("1",
"t.c", 6, __PRETTY_FUNCTION__), 0)));
There is nothing suspicious about the arguments to __builtin_expect.

This might be related to 
<https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=103017>

Comment 1 Ulrich Drepper 2004-10-04 07:42:44 UTC
I've removed __builtin_expect from the upstream glibc.  The result
will be in FC3 rawhide soon.

Comment 2 Jakub Jelinek 2004-10-06 18:32:42 UTC
The patch is in glibc-2.3.2-95.28 which ought to appear in U4 beta.

Comment 3 John Flanagan 2004-12-20 18:14:13 UTC
An errata has been issued which should help the problem 
described in this bug report. This report is therefore being 
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, 
please follow the link below. You may reopen this bug report 
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2004-586.html



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