[Bug 6398] New: CONFIG_USE_PORTABLE_CODE switch is backwards (and useless)

bugzilla at busybox.net bugzilla at busybox.net
Sat Jul 20 04:00:40 UTC 2013


https://bugs.busybox.net/show_bug.cgi?id=6398

           Summary: CONFIG_USE_PORTABLE_CODE switch is backwards (and
                    useless)
           Product: Busybox
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Other
        AssignedTo: unassigned at busybox.net
        ReportedBy: bugdal at aerifal.cx
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.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).

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?

-- 
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