This is the mail archive of the
mailing list for the GCC project.
Re: Question: at which version gcc started supporting -D_FORTIFY_SOURCE for c++ files?
- From: Ian Lance Taylor <iant at google dot com>
- To: "Oleg Pekar (olpekar)" <olpekar at cisco dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 22 Aug 2012 13:03:06 -0700
- Subject: Re: Question: at which version gcc started supporting -D_FORTIFY_SOURCE for c++ files?
- References: <AB5113908A1F7A489E444C528DC4E18D0F387387@xmb-aln-x06.cisco.com>
On Wed, Aug 22, 2012 at 12:38 PM, Oleg Pekar (olpekar)
> I'm using gcc 4.1.2, it supports -D_FORTIFY_SOURCE option for c files but not for c++. I'm looking for gcc version number where support for this option in c++ files was added.
I'm not sure how to answer your question, because -D_FORTIFY_SOURCE is
not a GCC feature. It is a glibc feature. It causes glibc to change
some function definitions to use features that are provided by GCC.
As far as I know, all the _FORTIFY_SOURCE features that GCC provides
are available in both C and C++.
So, please give us an example of something that fails with g++ and
-D_FORTIFY_SOURCE that you expect to work.