This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Forw: Question about mudflap
- From: "Frank Ch. Eigler" <fche at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 16 Nov 2005 08:47:12 -0500
- Subject: Forw: Question about mudflap
Date: Wed, 16 Nov 2005 03:20:54 -0500
From: "Doug Graham" <dgraham@nortel.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Subject: Question about mudflap
Hi,
Not sure whether I should report this as a bug or not, because there
might be something going on that I don't understand.
What I'm wondering is whether or not mudflap should instrument accesses
to globals that it doesn't know the size of. In the following code:
extern int global[];
int main(void)
{
printf("%d\n", global[3]);
global[5] = 42;
}
Mudflap does not emit any __mf_check calls. It does warn during
compilation:
t4-1.c:10: warning: mudflap cannot track unknown size extern 'global'
and I understand that, but I don't understand why this would prevent
it from checking accesses to the array. Is that a deliberate design
decision, or a bug? I'd much prefer if it did go on and check all
accesses to the array because in my case, global[] will always be
registered by the compilation unit in which it is defined. It's pretty
common to have extern decls whose sizes aren't known.
Thanks,
Doug.