Skip to content

Commit 734cf50

Browse files
committed
Remove redundant code from Compiler Annotations for C and C++ examples
Signed-off-by: Thomas Nyman <[email protected]>
1 parent 2b8dd5a commit 734cf50

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

docs/Compiler-Hardening-Guides/Compiler-Annotations-for-C-and-C++.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ void * my_malloc(size_t size) [[gnu::malloc]] [[gnu::malloc(my_free, 1)]];
104104
In `__attribute__` keyword syntax:
105105
106106
~~~c
107-
void my_free(void *ptr);
108-
109107
// Denotes that my_malloc will return with a dynamically allocated piece of memory which must be freed using my_free.
110108
void *my_malloc(size_t size) __attribute__ ((malloc, malloc (my_free, 1))) { … }
111109
~~~
@@ -365,13 +363,6 @@ In C++11 / C23 attribute syntax:
365363
~~~c
366364
// Denotes that fatal will never return
367365
void fatal () [[noreturn]];
368-
369-
void
370-
fatal (...)
371-
{
372-
... /* Print error message. */ ...
373-
exit (1);
374-
}
375366
~~~
376367

377368
In `__attribute__` keyword syntax:

0 commit comments

Comments
 (0)