This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Do not open .gcda/.gcno files in write mode unnecessarily.
- From: Ben Elliston <bje at au1 dot ibm dot com>
- To: Neil Vachharajani <nvachhar at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, jh at suse dot cz, nathan at codesourcery dot com
- Date: Fri, 18 Sep 2009 11:22:03 +1000
- Subject: Re: Do not open .gcda/.gcno files in write mode unnecessarily.
- References: <b3d309910909171123x357dc750m220b9236a3fce827@mail.gmail.com>
On Thu, 2009-09-17 at 11:23 -0700, Neil Vachharajani wrote:
> GCC currently always opens .gcda/.gcno files in write mode. This
> leads to permission denied errors when opening these files if the
> files are read-only. Having read-only .gcda files is useful to ensure
> that one does not unintentionally modify profile data (by default, an
> instrumented binary will append to .gcda files).
I agree with the need to allow users to protect profile data in this
way. I just wonder if the runtime code should produce a warning so that
users don't have to spend debugging time trying to work out why their
profile data isn't being updated?
Cheers,
Ben