diff options
author | Aliaksey Kandratsenka <alk@tut.by> | 2014-03-29 13:28:01 -0700 |
---|---|---|
committer | Aliaksey Kandratsenka <alk@tut.by> | 2014-03-29 13:32:23 -0700 |
commit | e3deb42d5dcdeeb8a340d03f207f2488ef3fb2eb (patch) | |
tree | dc7634640f125f3dddf4a621339a7ad57cac4aab | |
parent | 1a28754656bd6dfc1297d62a4c5811b0a5f03180 (diff) | |
download | gperftools-e3deb42d5dcdeeb8a340d03f207f2488ef3fb2eb.tar.gz |
issue-613: remove friend declaration from HeapLeakChecker
This applies patch by davide.italiano@10gen.com:
heap-checker.h contains the following friend declaration of main:
friend int main(int, char**).
C99 allows another declaration of main, i.e. int main(int, char**,
char**), and if code uses it and includes the heap-checker header,
this might result in a conflict, e.g.
error: declaration of C function 'int main(int, char**, char**)' conflicts with
int main(int argc, char* argv[], char** envp)
Actually the comment above the friend declaration of main() mentions
that this is required to get the unittest working and for other
internal usage, but I'm not completely sure if this is true as long as
I'm able to build and run the unittest removing the declaration.
-rw-r--r-- | src/gperftools/heap-checker.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/gperftools/heap-checker.h b/src/gperftools/heap-checker.h index 6c1187f..5a87d8d 100644 --- a/src/gperftools/heap-checker.h +++ b/src/gperftools/heap-checker.h @@ -240,9 +240,6 @@ class PERFTOOLS_DLL_DECL HeapLeakChecker { friend void NamedTwoDisabledLeaks(); friend void* RunNamedDisabledLeaks(void*); friend void TestHeapLeakCheckerNamedDisabling(); - // TODO(csilvers): remove this one, at least - friend int main(int, char**); - // Actually implements IgnoreObject(). static void DoIgnoreObject(const void* ptr); |