Re: tapeblocks is uninitialized in logtape.c - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: tapeblocks is uninitialized in logtape.c
Date
Msg-id 20180214210755.dgjsbah3544y5eld@alvherre.pgsql
Whole thread Raw
In response to Re: tapeblocks is uninitialized in logtape.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: tapeblocks is uninitialized in logtape.c  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:

> Actually, on looking closer, it's more likely got something to do with
> whether or not you used --enable-cassert.  If the Assert at the top of
> the function is disabled, then IMO a compiler that failed to complain
> about this coding would be pretty damn broken.

I tried removing the Assert, and my compiler doesn't complain.  I
noticed that the function is static and the only caller has its own
assert about ntapes; yet removing that one doesn't cause a warning
either.  I made the function non-static -- still no warning.

gcc (Debian 6.3.0-18) 6.3.0 20170516

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Nikolay Shaplov
Date:
Subject: Re: [PATCH][PROPOSAL] Add enum releation option type
Next
From: Tom Lane
Date:
Subject: Re: tapeblocks is uninitialized in logtape.c