[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
-Wconversion is braindead
From: |
Pascal Bourguignon |
Subject: |
-Wconversion is braindead |
Date: |
Sat, 9 Nov 2002 20:11:41 +0100 (CET) |
-Wconversion does not let pass anything to fun(char c).
With -Werror, it's forbiding any char parameter.
What a broken language and what a broken compiler option!
----------------------------(test.c)------------------------------------
#include <stdio.h>
extern void func(char c);
extern void funi(int c);
extern void caller(void);
void func(char c)
{
printf("%c",c);
}
void funi(int c)
{
printf("%c",c);
}
void caller(void)
{
char c='a';
unsigned char uc='a';
int i='a';
unsigned int ui='a';
func('a');
func(c);
func(uc);
func(i);
func(ui);
funi('a');
funi(c);
funi(uc);
funi(i);
funi(ui);
}
------------------------------------------------------------------------
$ gcc -Wconversion -c -o test.o test.c
test.c: In function `caller':
test.c:24: warning: passing arg 1 of `func' with different width due to
prototype
test.c:25: warning: passing arg 1 of `func' with different width due to
prototype
test.c:26: warning: passing arg 1 of `func' with different width due to
prototype
test.c:27: warning: passing arg 1 of `func' with different width due to
prototype
test.c:28: warning: passing arg 1 of `func' with different width due to
prototype
test.c:33: warning: passing arg 1 of `funi' as signed due to prototype
------------------------------------------------------------------------
--
__Pascal_Bourguignon__ http://www.informatimago.com/
----------------------------------------------------------------------
The name is Baud,...... James Baud.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- -Wconversion is braindead,
Pascal Bourguignon <=