This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix Stack Smashing Protector to protect functions with wchar_t arrays
On Thu, Sep 25, 2008 at 7:58 AM, Stefan Schulze Frielinghaus
<stefan@seekline.net> wrote:
>
> On Wed, 2008-09-24 at 11:22 -0700, Andrew Thomas Pinski wrote:
>> You cannot include c-common.h in the cfgexpand.c as some languages
>> don't implement any thing in c-common.h.
>
> Couldn't we move the wchar defines to tree.h too?
> Then we wouldn't need to include the c-common.h file.
> But I'm really not sure if that's the right way because I don't now how
> the integer_type_kind enum is used. See attached patch.
Also I don't think this will work for C code where wchar_t is a
typedef. What about the new UTF-16 and UTF-16 types too?
So if I read your patch and the code correctly this is so
-fstack-protect does the same does the same for wchar_t and char
arrays, correct? I wonder why we make char arrays as special anyways.
Seems like any integer arrays should be handled the same way.
Thanks,
Andrew Pinski