diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-13 14:57:24 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-13 14:57:24 +0200 |
commit | aa7da73880539713b14d19d6b34c2940c3579fcd (patch) | |
tree | 12f7dcdc55cdac0ce7eba2be7944da26ef52342d | |
parent | 7649bd024cbfcc12693ddd5c172cba93497aaed3 (diff) | |
download | busybox-w32-aa7da73880539713b14d19d6b34c2940c3579fcd.tar.gz busybox-w32-aa7da73880539713b14d19d6b34c2940c3579fcd.tar.bz2 busybox-w32-aa7da73880539713b14d19d6b34c2940c3579fcd.zip |
add USE_PORTABLE_CODE option and use it in find applet
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | Config.in | 8 | ||||
-rw-r--r-- | findutils/find.c | 4 |
2 files changed, 12 insertions, 0 deletions
@@ -30,6 +30,14 @@ config EXTRA_COMPAT | |||
30 | some GNU extensions in libc. You probably only need this option | 30 | some GNU extensions in libc. You probably only need this option |
31 | if you plan to run busybox on desktop. | 31 | if you plan to run busybox on desktop. |
32 | 32 | ||
33 | config USE_PORTABLE_CODE | ||
34 | bool "Avoid using GCC-specific code constructs" | ||
35 | default n | ||
36 | help | ||
37 | Use this option if you are trying to compile busybox with | ||
38 | compiler other than gcc. | ||
39 | If you do use gcc, this option may needlessly increase code size. | ||
40 | |||
33 | choice | 41 | choice |
34 | prompt "Buffer allocation policy" | 42 | prompt "Buffer allocation policy" |
35 | default FEATURE_BUFFERS_USE_MALLOC | 43 | default FEATURE_BUFFERS_USE_MALLOC |
diff --git a/findutils/find.c b/findutils/find.c index ba8fa0854..76f670942 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -276,7 +276,11 @@ ACTF(inum) | |||
276 | ACTF(exec) | 276 | ACTF(exec) |
277 | { | 277 | { |
278 | int i, rc; | 278 | int i, rc; |
279 | #if ENABLE_USE_PORTABLE_CODE | ||
280 | char **argv = alloca(sizeof(char*) * (ap->exec_argc + 1)); | ||
281 | #else /* gcc 4.3.1 generates smaller code: */ | ||
279 | char *argv[ap->exec_argc + 1]; | 282 | char *argv[ap->exec_argc + 1]; |
283 | #endif | ||
280 | for (i = 0; i < ap->exec_argc; i++) | 284 | for (i = 0; i < ap->exec_argc; i++) |
281 | argv[i] = subst(ap->exec_argv[i], ap->subst_count[i], fileName); | 285 | argv[i] = subst(ap->exec_argv[i], ap->subst_count[i], fileName); |
282 | argv[i] = NULL; /* terminate the list */ | 286 | argv[i] = NULL; /* terminate the list */ |