Thread: GCC 4.4 compiler warnings

GCC 4.4 compiler warnings

From
Peter Eisentraut
Date:
GCC 4.4 produces a bunch of new compiler warnings against 8.4; see attached 
output.  Some of these are related to our old friend fastgetattr(), but it's a 
bit too late for me to make sense of it now.

As we have grown accustomed to warnings-free builds, it would be nice to fix 
these.

Re: GCC 4.4 compiler warnings

From
Grzegorz Jaskiewicz
Date:
if that's without -O3, than please retry it with. It will give even  
more.



Re: GCC 4.4 compiler warnings

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> GCC 4.4 produces a bunch of new compiler warnings against 8.4; see attached 
> output.  Some of these are related to our old friend fastgetattr(), but it's a 
> bit too late for me to make sense of it now.

> As we have grown accustomed to warnings-free builds, it would be nice to fix 
> these.

I've fixed all the 'variable may be used uninitialized' warnings that
I see in a basic build (there might be some others in optional code).

The 'value computed is not used' warnings all seem to come from these
lines in fastgetattr():
   (((isnull) != NULL) ? (*(isnull) = false) : (dummyret)NULL),    \
...           (((isnull) != NULL) ? (*(isnull) = true) : (dummyret)NULL),    \

Since there isn't any obvious better way to do this, I consider this
warning to be a gcc bug, and have filed it accordingly:
https://bugzilla.redhat.com/show_bug.cgi?id=497545
        regards, tom lane


Re: GCC 4.4 compiler warnings

From
Grzegorz Jaskiewicz
Date:

This is the list of stuff that gcc reports in -Wall and -O3, which by
default it doesn.t Some are probably worth looking at, knowing gcc
from my own ground about 50% is going to be rather bogus, which still
leaves few.

thanks
Attachment

Re: GCC 4.4 compiler warnings

From
Grzegorz Jaskiewicz
Date:
and a quick one on mac os x, which looks like it has something to do
with COMPLETE_WITH_LIST() and macros like that, and maybe with
completion_matches on mac os x. I don't get these on linux.
This is from gcc4.4 with -O3 (which obviously causes gcc to find more
potential warnings).


tab-complete.c: In function 'psql_completion':•
tab-complete.c:666: warning: implicit declaration of function
'completion_matches'•
tab-complete.c:666: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:670: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:675: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:683: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:699: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:709: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:720: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:730: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:742: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:752: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:762: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:777: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:785: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:794: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:804: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:814: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:824: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:834: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:843: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:851: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:856: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:862: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:871: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:876: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:889: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:899: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:909: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:918: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:925: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:935: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:941: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:948: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:957: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:963: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:975: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:979: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:985: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:994: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1000: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1009: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1018: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1028: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1035: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1045: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1056: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1066: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1075: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1082: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1088: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1098: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1106: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1110: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1117: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1126: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1131: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1141: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1146: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1156: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1166: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1173: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1185: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1194: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1202: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1214: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1225: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1236: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1242: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1249: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1255: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1260: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1264: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1274: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1276: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1281: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1285: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1292: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1299: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1304: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1313: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1320: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1325: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1334: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1346: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1356: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1363: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1374: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1379: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1389: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1400: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1415: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1427: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1438: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1445: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1450: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1458: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1466: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1481: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1485: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1493: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1503: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1510: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1549: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1554: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1562: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1573: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1579: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1583: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1592: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1605: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1613: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1624: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1635: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1644: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1658: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1667: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1679: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1684: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1700: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1715: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1717: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1719: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1721: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1723: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1725: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1727: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1736: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1741: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1746: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1750: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1755: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1767: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1777: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1783: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1788: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1792: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1801: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1816: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1821: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1825: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1830: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1835: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1839: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1848: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1853: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1856: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1860: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1864: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1869: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1877: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1882: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1884: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1887: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1898: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1900: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1918: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1928: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1941: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1952: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1959: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1971: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1980: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1985: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1993: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:1999: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2003: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2009: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2022: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2029: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2036: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2043: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2049: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2053: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2057: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2062: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2065: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2073: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2078: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2086: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2091: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2097: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2104: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2111: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2119: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2126: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2132: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2136: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2140: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2146: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2150: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2155: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2160: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2167: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2173: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2176: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2178: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2180: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2182: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2184: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2186: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2189: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2191: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2193: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2195: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2198: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2201: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2203: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2205: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2207: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2209: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2211: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2213: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2215: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2219: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2222: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2225: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2227: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2229: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2237: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2247: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2264: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2266: warning: assignment makes pointer from integer
without a cast•
tab-complete.c:2280: warning: assignment makes pointer from integer
without a cast

Re: GCC 4.4 compiler warnings

From
Tom Lane
Date:
Grzegorz Jaskiewicz <gj@pointblue.com.pl> writes:
> tab-complete.c:666: warning: implicit declaration of function  
> 'completion_matches'

Are you sure you have a real installation of readline?  OSX is
notorious for providing a bogus one, particularly in older
release series.
        regards, tom lane


Re: GCC 4.4 compiler warnings

From
Grzegorz Jaskiewicz
Date:
On 26 Apr 2009, at 16:22, Tom Lane wrote:

> Grzegorz Jaskiewicz <gj@pointblue.com.pl> writes:
>> tab-complete.c:666: warning: implicit declaration of function
>> 'completion_matches'
>
> Are you sure you have a real installation of readline?  OSX is
> notorious for providing a bogus one, particularly in older
> release series.

Sure, it behaves quite strange - gotta say. So I'll try to recompile  
against vanilla readline, and see if it still causes problems.
But what about all those warnings I posted here earlier ? Those were  
from fedora 9, and vanillia gcc 4.4




Re: GCC 4.4 compiler warnings

From
Tom Lane
Date:
I wrote:
> Since there isn't any obvious better way to do this, I consider this
> warning to be a gcc bug, and have filed it accordingly:
> https://bugzilla.redhat.com/show_bug.cgi?id=497545

As of CVS HEAD and gcc 4.4.0-3, we seem to be warning-free in a standard
build.  I did not try many optional build flags though.
        regards, tom lane


Re: GCC 4.4 compiler warnings

From
Andy Lester
Date:
On Apr 29, 2009, at 11:32 AM, Tom Lane wrote:

> As of CVS HEAD and gcc 4.4.0-3, we seem to be warning-free in a  
> standard
> build.  I did not try many optional build flags though.


I'm also working on a set of extra-stringent build flags for GCC 4.4.  
The more we can get the compiler to watch for, the better.

--
Andy Lester => andy@petdance.com => www.theworkinggeek.com => AIM:petdance