From c40c4d035b6af9abb2acf10003491dd1501c6cec Mon Sep 17 00:00:00 2001 From: Richard Thier Date: Thu, 24 Apr 2025 18:32:39 +0200 Subject: [PATCH] added gcc example for inner-function definitions and declarations with the "auto" keyword --- innerf.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 innerf.c diff --git a/innerf.c b/innerf.c new file mode 100644 index 0000000..5bfcaec --- /dev/null +++ b/innerf.c @@ -0,0 +1,25 @@ +#include + +int main() { + int a = 0; + int b = 40; + int c = 2; + + inline void lf(register int* r) { + a += *r; + }; // semicolon(;) not needeed! + + /* + // Same as above... + inline auto void lf(register int* r); + inline void lf(register int* r) { + a += *r; + }; // semicolon(;) not needeed! + */ + + lf(&b); + lf(&c); + + printf("%d\n", a); +} +