[Bug c/46115] Feature request: anonymous functions (complementing anon aggregates)

2021-01-16 Thread muecker at gwdg dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46115

Martin Uecker  changed:

   What|Removed |Added

 CC||muecker at gwdg dot de

--- Comment #7 from Martin Uecker  ---
The documentation implies that the pointer escaping the scope and calling the
function is safe as long as it does not access a variable of the enclosing
function that went out of scope.

[Bug c/46115] Feature request: anonymous functions (complementing anon aggregates)

2015-03-15 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46115

--- Comment #6 from Andrew Pinski  ---
(In reply to Rob Staudinger from comment #3)
> For the record, this is already possible using bracketed expressions, but
> the syntactical sugar of not having to pick a function name would be great.

Actually that is not valid as func is local to that scope and now it escapes.


[Bug c/46115] Feature request: anonymous functions (complementing anon aggregates)

2015-03-15 Thread shawn at churchofgit dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46115

--- Comment #5 from Shawn Landden  ---
http://mackyle.github.io/blocksruntime/#download


[Bug c/46115] Feature request: anonymous functions (complementing anon aggregates)

2015-03-15 Thread shawn at churchofgit dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46115

Shawn Landden  changed:

   What|Removed |Added

 CC||shawn at churchofgit dot com

--- Comment #4 from Shawn Landden  ---
There is also the Apple blocks extension to C.
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1370.pdf
http://clang.llvm.org/docs/Block-ABI-Apple.html#history


[Bug c/46115] Feature request: anonymous functions (complementing anon aggregates)

2010-10-25 Thread robert.staudinger at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46115

--- Comment #3 from Rob Staudinger  
2010-10-25 07:31:59 UTC ---
For the record, this is already possible using bracketed expressions, but the
syntactical sugar of not having to pick a function name would be great.

#include 
#include 

int
main (int argc, char **argv)
{
  void (*func_ptr)(int) = ({ void func(int i) { printf ("%i\n", i); };
 func;
   });

  func_ptr (3);

  return EXIT_SUCCESS;
}


[Bug c/46115] Feature request: anonymous functions (complementing anon aggregates)

2010-10-22 Thread robert.staudinger at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46115

--- Comment #2 from Rob Staudinger  
2010-10-22 08:33:46 UTC ---
There obviously is some relation, but this proposal evades syntactical
overloading of operators, unlike C++ lambda functions or LLVM blocks.


[Bug c/46115] Feature request: anonymous functions (complementing anon aggregates)

2010-10-21 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46115

--- Comment #1 from Andrew Pinski  2010-10-21 
18:38:31 UTC ---
This sounds like C++ lambda functions.

Second,  I think this is a bad idea for C.