This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-Wconversion producing incorrect warning


When compiling this program:

#include <sys/types.h>
#include <inttypes.h>

typedef uint16_t t;

int f(t x)
{
	return x*x;
}

int main(int argc, char *argv[])
{
	t b = 12;

	return f(b);
}

using GCC 3.3.5, 3.4.3 and 4.0.1 with '-Wconversion' in effect, I get this warning:

luigi.c: In function `main':
luigi.c:15: warning: passing arg 1 of `f' with different width due to prototype


I don't understand why this is true... the prototype and the argument are of the same type.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]