Bug 33530
Summary: | void * arithmetic in bits/string2.h | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Peter Ajamian <peter> |
Component: | glibc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED WORKSFORME | QA Contact: | Aaron Brown <abrown> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.0 | CC: | fweimer, peter |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i586 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2001-03-28 06:41:27 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
Peter Ajamian
2001-03-28 01:03:53 UTC
I just noticed that rpm is compiling with the -Wpointer-arith flag, I suspect that that is also needed to generate the warning. Additional info: $rpm -q glibc glibc-2.2-12 The version of rpm I am attempting to compile is rpm-4.0.2-7x which has been tweaked to add in the above mentioned patch. When I get time later on I'll try to come up with a simple test case that will reproduce the problem. Okay, I managed to reproduce this in very simple means (note it also requires optimization to be turned on)... #!/bin/sh cat << EOF > test.c #include <string.h> int main(void) {return 0;} EOF gcc -O -Wpointer-arith -o /dev/null test.c Output of this is as follows... /usr/include/bits/string2.h: In function `__strcpy_small': In file included from /usr/include/string.h:361, from test.c:1: /usr/include/bits/string2.h:418: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:426: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:431: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:436: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:438: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:443: warning: pointer of type `void *' used in arithmetic Just to verify that the file string2.h _really_ came from where I think it does... $rpm -qf /usr/include/bits/string2.h glibc-devel-2.2-12 $rpm -V glibc-devel-2.2-12 $ Sorry to keep tacking more onto this, anyways... I found this GNU bug report for libc which describes the problem: http://bugs.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=1501&database=default I reported this one as ver 7.0 because I had updated glibc to version 2.2, but I'm still running gcc from RedHat 6.0 (which is actually egcs). Apparently updating to a version of gcc >= 2.96 _should_ fix the problem (though I'm not gonna bother testing it since I now know that it's not a warning which need be taken seriously). I'll leave this for someone else to close out because it may warrant an errata for 6.x. The question is which compiler do you use. This is a compiler bug and it is for sure fixed in both gcc-2.96-RH and compat-egcs we shipped in 7.0. 2.95.2 does not have this fixed and from quick look at the 2.95.2 -> 2.95.3 diff 2.95.3 probably does not have it fixed either. gcc supports void * arithmetics as an extension, and this is clearly marked with __extension__. |