This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/65724] __builtin_object_size difference for C and C++
- From: "xur at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 09 Apr 2015 21:29:20 +0000
- Subject: [Bug tree-optimization/65724] __builtin_object_size difference for C and C++
- Auto-submitted: auto-generated
- References: <bug-65724-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65724
--- Comment #2 from xur at google dot com ---
Do you mean the result of 0 in g++ is intentional?
But I'm not quite understand the relation with _FORTIFY_SOURCE=2. This
macro does not seem to be check in tree-objsz pass.
In other words, if I unset _FORTIFY_SOURCE or set it 1, I still get the
same result.
Could you give me some pointer of the reference that I can check?
Thanks,
Rong
On Thu, Apr 9, 2015 at 2:05 PM, jakub at gcc dot gnu.org <
gcc-bugzilla@gcc.gnu.org> wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65724
>
> Jakub Jelinek <jakub at gcc dot gnu.org> changed:
>
> What |Removed |Added
>
> ----------------------------------------------------------------------------
> CC| |jakub at gcc dot gnu.org
>
> --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> Well, C has flexible array members, while C++ does not have those, so
> there is
> a significant difference in between the two. And when you embed a [0]
> array
> into another structure, it is intentional that _FORTIFY_SOURCE=2 (i.e. the
> more
> restrictive mode, beyond the standards) only allows to fill the fields and
> not
> cross to outside of that.
>
> --
> You are receiving this mail because:
> You reported the bug.
>