[lug] [OT] more gcc queries

Daniel Webb lists at danielwebb.us
Sun Oct 10 19:50:03 MDT 2004


#include<stdbool.h>
void f(bool d);

int main(void)
{
  bool b = false;
  f(b);
  return 1;
}

$ gcc -c -Wconversion test.c
test.c: In function `main':
test.c:8: warning: passing arg 1 of `f' with different width due to prototype
$

Why?  The reference I'm using ("Expert C Programming" by var der Linden),
says: "In ANSI C, arguments are not promoted if a prototype is used; otherwise
they are."

Daniel



More information about the LUG mailing list