[PATCH] strict types in code generators.
Marcin Dalecki
martin@dalecki.de
Wed Mar 2 14:17:00 GMT 2005
On 2005-03-02, at 06:09, Zack Weinberg wrote:
>
> It would help if you would show the error messages you're getting from
> the C++ compiler, or the difference in generated code that you are
> trying to achieve. Right now I am failing to guess what the point is.
Without any part of my patch I get the following:
c++ -c -O2 -fsigned-char -DIN_GCC -W -Wall -Wwrite-strings
-Wstrict-prototyp
es -Wmissing-prototypes -fno-common -DHAVE_CONFIG_H -I. -I.
-I../../gcc -I
../../gcc/. -I../../gcc/../include -I./../intl
-I../../gcc/../libcpp/include -I/
opt/include ../../gcc/c-common.c -o c-common.o
../../gcc/c-common.c: In function `tree_node*
c_common_type_for_mode(machine_mode, int)':
../../gcc/c-common.c:1633: error: cannot convert `const unsigned char'
to `
machine_mode' in assignment
../../gcc/c-common.c:1640: error: cannot convert `const unsigned char'
to `
machine_mode' in initialization
../../gcc/c-common.c: In function `tree_node*
c_common_signed_or_unsigned_type(int, tree_node*)':
../../gcc/c-common.c:1727: warning: comparison between signed and
unsigned
integer expressions
../../gcc/c-common.c: In function `tree_node*
c_build_qualified_type(tree_node*, int)':
../../gcc/c-common.c:2514: warning: comparison between signed and
unsigned
integer expressions
../../gcc/c-common.c: In function `tree_node*
c_sizeof_or_alignof_type(tree_node*, tree_code, int)':
Please take a look at finish_root_table too. This is the generic case
and
it is playing precisely the same "extern const" game as the patch I
propose. However
you are right the extern stuff isn't strictly required and I can't
reproduce any error
without it.
More information about the Gcc-patches
mailing list