| Anonymous | Login | Signup for a new account | 11-10-2008 10:49 PST |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0000414 | [BusyBox] Other | minor | always | 09-06-05 04:36 | 09-06-05 14:50 | ||||
| Reporter | des | View Status | public | ||||||
| Assigned To | BusyBox | ||||||||
| Priority | normal | Resolution | duplicate | ||||||
| Status | closed | Product Version | 1.00 | ||||||
| Summary | 0000414: Incorrect include ordering can lead to build failure | ||||||||
| Description |
Note: actual version is 1.01, which isn't listed in the "Product Version" pull-down menu in the bug tracking system busybox.h includes config.h before anything else. config.h defines or undefines various CONFIG_FOO macros depending on which parts of BusyBox are to be built. Some of these macros conflict with similarly-named macros defined in <linux/autoconf.h> which is pulled in indirectly by <limits.h> and / or <sys/param.h> near the bottom of busybox.h. This can lead to a build failure in applets.c. Let's say you want to build busybox without the sysctl applet, so config.h contains #undef CONFIG_SYSCTL. applets.c includes busybox.h busybox.h includes config.h -> #undef CONFIG_SYSCTL busybox.h defines PROTOTYPES and includes applets.h busybox.h includes <sys/param.h> -> #define CONFIG_SYSCTL 1 applets.c defines MAKE_USAGE and includes applets.h applets.c undefines PROTOTYPES and MAKE_USAGE and includes applets.h to generate the applets[] array applets[] references an undeclared and undefined sysctl_main() -> BOOM |
||||||||
| Additional Information |
The attached patch 1) reorders includes in busybox.h to avoid the issue described above 2) moves #include <features.h> to the top of busybox.h (it has to be at the top to correctly affect visibility of identifiers declared by other headers) 3) makes a few adjustments to applets.h to simplify its usage 4) removes a few #undefs made redundant by 3) from applets.c |
||||||||
| Attached Files |
|
||||||||
|
|
|||||||||
| Copyright © 2000 - 2006 Mantis Group |