You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As main gets strings as arguments, it would be interesting to transform some of those strings into calls to functions (for example, associating those strings to function pointers in a lookup array). However, I could find not way to express a pointer to function and run it. For example, let's take a function which takes an int and returns an int. In C, a typedef is usually declared:
typedef int (*pFct)(int);
This construct is unsupported. Moreover, defining a function with such a pointer-to-function is unsupported either. E.g.:
int executeMe(int(*pFct)(int), int val) {return pFct(int);}
Is there a workaround? It could significantly improve scripts in an constrained embedded environment.
If not, and if you can suggest where in the source code this feature could be implemented, I would be happy to try this myself. But maybe this is a fundamentally tough undertaking...
The text was updated successfully, but these errors were encountered:
As
main
gets strings as arguments, it would be interesting to transform some of those strings into calls to functions (for example, associating those strings to function pointers in a lookup array). However, I could find not way to express a pointer to function and run it. For example, let's take a function which takes anint
and returns anint
. In C, atypedef
is usually declared:typedef int (*pFct)(int);
This construct is unsupported. Moreover, defining a function with such a pointer-to-function is unsupported either. E.g.:
int executeMe(int(*pFct)(int), int val) {return pFct(int);}
Is there a workaround? It could significantly improve scripts in an constrained embedded environment.
If not, and if you can suggest where in the source code this feature could be implemented, I would be happy to try this myself. But maybe this is a fundamentally tough undertaking...
The text was updated successfully, but these errors were encountered: