Bugzilla will be upgraded to version 5.0 on December 2, 2018. The outage period for the upgrade will start at 0:00 UTC and have a duration of 12 hours
Bug 4775 - egcs does not honor __extension__
egcs does not honor __extension__
Product: Red Hat Raw Hide
Classification: Retired
Component: egcs (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
Depends On:
  Show dependency treegraph
Reported: 1999-08-30 01:00 EDT by Cristian Gafton
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 1999-09-22 10:17:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Cristian Gafton 1999-08-30 01:00:59 EDT
In /usr/include/bits/string2.h there are a number of
constructs like
   __u = __extension__ ((void *) __u + 2);

When this code is compile with -Wpointer-arith the compile
will complain about it:

/usr/include/bits/string2.h:419: warning: pointer of type
`void *' used in arithmetic
/usr/include/bits/string2.h:427: warning: pointer of type
`void *' used in arithmetic
/usr/include/bits/string2.h:432: warning: pointer of type
`void *' used in arithmetic
/usr/include/bits/string2.h:437: warning: pointer of type
`void *' used in arithmetic
/usr/include/bits/string2.h:439: warning: pointer of type
`void *' used in arithmetic
/usr/include/bits/string2.h:444: warning: pointer of type
`void *' used in arithmetic

Because these things are marked with __extension__ the
compiler should understand that that is the indended use and
quit whining. This is very annoying and we need it fixed
quite fast :-)

It seems to be a bug in the current compile - it seems that
gcc 2.95 does not ahve the problem, so maybe there is a
possibility of backporting a patch...
Comment 1 Jim Kingdon 1999-08-30 15:26:59 EDT
For Ulrich's reaction see

Are you sure this changed in GCC 2.95?  Looking at the source
to 2.95 I don't see anything which has __extension__ interact with
anything other than -pedantic (which is the way it is documented).

Off the top of my head it strikes me as better to patch glibc
(which recently changed on this point) rather than patching gcc
(which has not changed the behavior of __extension__ in a long
time), if we really do need something fast.  Patching gcc in a way
that the gcc maintainers won't end up liking would just make things
Comment 2 Cristian Gafton 1999-08-30 15:32:59 EDT
I do not get those warnings with gcc 2.95, so something changed and
made the compiler to correctly protect extensios against
-Wpointer-arith. It *is* a bug in the compiler.
Comment 3 Jim Kingdon 1999-08-30 16:11:59 EDT
I just tried this with the latest gcc from cvs and I got the same
warnings (test case enclosed in the email section).
If you want to point me to a gcc 2.95 binary (or wait for me to
download and build it), I can try that too but I really don't think
the version of gcc has much to do with it.  Were you using -O in
your tests (that is required since string.h tests __OPTIMIZE__)?

I mean, I'll send email to gcc-bugs and see if people have reactions
(and I can certainly write a patch if that is what we want).  But if
this is a matter of just backporting code which is already
there, I am missing something in a big way.
Comment 4 Jim Kingdon 1999-09-06 21:52:59 EDT
Patch at
and in egcs-1.1.2-23.
Comment 5 Jim Kingdon 1999-09-21 17:32:59 EDT
Still working on getting this into GCC:
Comment 6 Jim Kingdon 1999-09-22 10:17:59 EDT
Checked into GCC mainline (ChangeLog entry dated 22 Sep 1999).

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