delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/09/19:17:20

Message-Id: <200008092306.TAA18952@websmtp1.bellsouth.bigfoot.com>
To: djgpp AT delorie DOT com
Subject: Conversion warnings
From: "Lets Go Canes!" <LetsGoCanes AT webmail DOT bellsouth DOT net>
Date: Wed, 09 Aug 2000 19:19:02 -0400
X-Originating-IP: 216.76.129.69
Reply-To: djgpp AT delorie DOT com

Hi all.

While compiling a program, I am getting some strange
conversion warnings - I have -Wconversion enabled
intentionally to catch unintended conversions.

The following short sample will demonstrate:

----------
void    f(float, char);

int main(void)
{
    float   x;
    char    c;

    x = 22.0 / 7.0;
    c = '*';
    
    f(x, c);
    return 1;

}
----------

When compiled, it gives the following output:

gcc -Wconversion -c test.c
test.c: In function `main':
test.c:11: warning: passing arg 1 of `f' as `float' rather than `double' due to prototype
test.c:11: warning: passing arg 2 of `f' with different width due to prototype

Any ideas?

---------------
Let's Go Canes!

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019