awk: empty function becomes "undefined function"

Jody Lee Bruchon jody at jodybruchon.com
Wed Oct 9 17:36:37 UTC 2013


Apologies if this is already fixed; I can't check against trunk right now and don't see references to this problem online.

While compiling gcc-4.8.1 in a uClibc environment with BusyBox providing 'awk' my compilation aborts with an "undefined function" error. Upon inspection of the offending awk script, the "undefined" function is in fact defined prior to use, but all lines within the function are # commented out. I assume awk is dropping the function definition since the function is empty. GNU awk apparently keeps the function definition and simply does nothing since the body is effectively empty.

I attempted to figure out how awk is making this error, but to be honest, the BusyBox awk code is too complex for me to figure out and debug in a reasonable time frame, so I defer to the experts here. :-)

Regards,
Jody Lee Bruchon


More information about the busybox mailing list