[Bug 6398] CONFIG_USE_PORTABLE_CODE switch is backwards (and useless)
bugzilla at busybox.net
bugzilla at busybox.net
Mon Jul 22 02:29:41 UTC 2013
https://bugs.busybox.net/show_bug.cgi?id=6398
--- Comment #1 from Denys Vlasenko <vda.linux at googlemail.com> 2013-07-22 02:29:57 UTC ---
(In reply to comment #0)
> The only place this setting is used is in findutils/find.c:
>
> #if ENABLE_USE_PORTABLE_CODE
> char **argv = alloca(sizeof(char*) * (ap->exec_argc + 1));
> #else /* gcc 4.3.1 generates smaller code: */
> char *argv[ap->exec_argc + 1];
> #endif
>
> The code under ENABLE_USE_PORTABLE_CODE is using a non-portable GCC feature,
> alloca. The code in the #else block is using portable code (VLA).
alloca is supported by any C compiler, whereas variable-length arrays are not.
> With that said, having this option makes no sense at all if this is the only
> place it's used. I'm pretty sure busybox makes plenty use of alloca elsewhere
> already, so why not just pick whichever case generates better code and remove
> this useless (and very confusing) option?
This code was requested by people who use C compiler which doesn't support
variable length arrays.
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list