Attaching function definitions depends on the GCC extension for operation. It is not described by the standard.
If you want your code to work with other compilers, you should refrain from using such methods. What else, if you work with other developers, I predict that many of them will not like the use of such custom designs.
I'm not an expert with GCC, but I'm sure there are compiler options for disabling extensions. This will allow you to get a compiler to make sure that you are not writing code that will not compile with other compilers.
As for your update, nested functions are used. They can help encapsulate, limiting volume and visibility. However, there is no problem that cannot be solved quite adequately without nested functions, which, I think, explain why they are rarely used by the GCC feature.
source share