/usr/include/bits/string2.h vs. `gcc -Wpointer-arith'

Martin Buchholz martin@xemacs.org
Sun Mar 12 14:13:00 GMT 2000


>>>>> "Ulrich" == Ulrich Drepper <drepper@redhat.com> writes:

Ulrich> Martin Buchholz <martin@xemacs.org> writes:
>> If I compile XEmacs on a Mandrake 7.0 Linux system, based on glibc
>> 2.1, I get these warnings:

Ulrich> Remove the useless -Wpointer-arith warning or fix gcc.

The `-Wpointer-arith' warning is useful for developers who write code
for use with any C compiler, but do their own development with gcc.

Please let's not have a situation where the gcc and glibc developers
consider the bug the other project's, and the user is left without a
useful error checking tool.

I believe both glibc and gcc should change.

I agree with Ulrich that "__extension__ ((void *) foo + 3)" should not
generate a warning with "gcc -Wpointer-arith".  gcc should be fixed.

Although glibc exported header files are currently probably only used
with gcc, there is no reason why this should be true in the future as
well.  Using portable C in glibc's system header files just seems like
good engineering practice today.  So glibc should also be fixed.  (And
I did provide a patch.) 

Imagine an effort to port glibc to Solaris, with the aim of replacing
the native libc.  A policy of using gcc extensions in the glibc
exported headers would provide a disincentive to any such project,
especially if it were to be funded by Sun.

Use standard C whenever possible without loss of performance.  Even in
code fragments specifically targeted at gcc.

Martin


More information about the Gcc-bugs mailing list