aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2021-02-07 17:21:32 -0700
committerMartin Sebor <msebor@redhat.com>2021-02-07 17:24:23 -0700
commitfe2034e9c039c998fc5da730ed531c61cf2e0b7d (patch)
treed06d56423f85b2c45f330dfe15df249c5d371edb
parentba65576027700490f366d9107669b108bb1b7187 (diff)
downloadgcc-fe2034e9c039c998fc5da730ed531c61cf2e0b7d.zip
gcc-fe2034e9c039c998fc5da730ed531c61cf2e0b7d.tar.gz
gcc-fe2034e9c039c998fc5da730ed531c61cf2e0b7d.tar.bz2
Correct typos in attribute malloc documentation.
gcc/ChangeLog: * doc/extend.texi (attribute malloc): Correct typos.
-rw-r--r--gcc/doc/extend.texi18
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 2cfd8cd..e110cb0 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -3258,7 +3258,9 @@ objects.
Associating a function with a @var{deallocator} helps detect calls to
mismatched allocation and deallocation functions and diagnose them under
-the control of options such as @option{-Wmismatched-dealloc}. To indicate
+the control of options such as @option{-Wmismatched-dealloc}. It also
+makes it possible to diagnose attempts to deallocate objects that were not
+allocated dynamically, by @option{-Wfree-nonheap-object}. To indicate
that an allocation function both satisifies the nonaliasing property and
has a deallocator associated with it, both the plain form of the attribute
and the one with the @var{deallocator} argument must be used. The same
@@ -3273,21 +3275,21 @@ not alias any others, the following declarations make @code{fclose}
a suitable deallocator for pointers returned from all functions except
@code{popen}, and @code{pclose} as the only suitable deallocator for
pointers returned from @code{popen}. The deallocator functions must
-declared before they can be referenced in the attribute.
+be declared before they can be referenced in the attribute.
@smallexample
int fclose (FILE*);
int pclose (FILE*);
-__attribute__ ((malloc, malloc (fclose (1))))
- FILE* fdopen (int);
-__attribute__ ((malloc, malloc (fclose (1))))
+__attribute__ ((malloc, malloc (fclose, 1)))
+ FILE* fdopen (int, const char*);
+__attribute__ ((malloc, malloc (fclose, 1)))
FILE* fopen (const char*, const char*);
-__attribute__ ((malloc, malloc (fclose (1))))
+__attribute__ ((malloc, malloc (fclose, 1)))
FILE* fmemopen(void *, size_t, const char *);
-__attribute__ ((malloc, malloc (pclose (1))))
+__attribute__ ((malloc, malloc (pclose, 1)))
FILE* popen (const char*, const char*);
-__attribute__ ((malloc, malloc (fclose (1))))
+__attribute__ ((malloc, malloc (fclose, 1)))
FILE* tmpfile (void);
@end smallexample