[lug] [OT] gcc possible bug

Zan Lynx zlynx at acm.org
Sun Oct 10 10:31:24 MDT 2004


On Sun, 2004-10-10 at 01:34 -0600, Daniel Webb wrote:
> On Sat, Oct 09, 2004 at 08:02:35PM -0600, Zan Lynx wrote:
> 
> > All of those value types convert to each-other, so no error.  And its
> > find and valid to ignore return values.  printf has a return value, do
> > you ever check it? :-)
> 
> Hmmm...  When did this change?  I'm pretty sure gcc 2.95 warned about passing
> a double variable into an int parameter.  I'm so confused.  double type
> converts into int automatically?  I thought it was only the other way around.
> Warning about conflicting types in function parameter lists catches so many
> bugs, in my experience.  If you're really passing a double variable to a
> function to an int parameter, you'd be insane not to explicitly typecast.  I
> haven't ever seen a case where that wasn't true, but my code is fairly simple.
> 
> Well, at least the next "bug" I found 5 minutes later turned out to really be
> a bug, but of course it was reported 6 months ago and was so hairy it was only
> fixed since the last point release.

I looked at GCC docs a little.  You might find -Wconversion to be
helpful.
-- 
Zan Lynx <zlynx at acm.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20041010/1ce90113/attachment.pgp>


More information about the LUG mailing list