Message ID | 4EB1819C.6080800@oracle.com |
---|---|
State | New |
Headers | show |
On 11/02/2011 01:45 PM, Paolo Carlini wrote: > ... ehm, we use -Wcast-qual during the bootstrap, thus if I don't want > to break it again, better doing the below too. Seems obvious, by itself. Yep. Jason
On 11/02/2011 07:26 PM, Jason Merrill wrote: > On 11/02/2011 01:45 PM, Paolo Carlini wrote: >> ... ehm, we use -Wcast-qual during the bootstrap, thus if I don't want >> to break it again, better doing the below too. Seems obvious, by itself. > Yep. Great, all done. Note for the accidental reader: it's indeed obvious, but only if you are used to the C++ memchr, the two overloads. For the targets (many outside Linux) not providing those (via libc hooks) I would not have broken the bootstrap ;) Paolo.
Another bootstrap issue: In file included from /home/jason/src/trunk/gcc/fortran/cpp.c:35:0: /home/jason/src/trunk/gcc/fortran/../../libcpp/internal.h: In function ‘unsigned char* ustrchr(const unsigned char*, int)’: /home/jason/src/trunk/gcc/fortran/../../libcpp/internal.h:782:55: error: cast from type ‘const char*’ to type ‘unsigned char*’ casts away qualifiers [-Werror=cast-qual]
On 11/02/2011 08:12 PM, Jason Merrill wrote: > Another bootstrap issue: > > In file included from /home/jason/src/trunk/gcc/fortran/cpp.c:35:0: > /home/jason/src/trunk/gcc/fortran/../../libcpp/internal.h: In function > ‘unsigned char* ustrchr(const unsigned char*, int)’: > /home/jason/src/trunk/gcc/fortran/../../libcpp/internal.h:782:55: > error: cast from type ‘const char*’ to type ‘unsigned char*’ casts > away qualifiers [-Werror=cast-qual] Argh, I'll fix it momentarily. Paolo.
Index: builtins.c =================================================================== --- builtins.c (revision 180778) +++ builtins.c (working copy) @@ -8427,7 +8427,7 @@ fold_builtin_memchr (location_t loc, tree arg1, tr if (target_char_cast (arg2, &c)) return NULL_TREE; - r = (char *) memchr (p1, c, tree_low_cst (len, 1)); + r = (const char *) memchr (p1, c, tree_low_cst (len, 1)); if (r == NULL) return build_int_cst (TREE_TYPE (arg1), 0);