BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001171 [BusyBox] Standards Compliance block always 01-23-07 05:04 06-16-07 16:20
Reporter andreasz View Status public  
Assigned To vda
Priority normal Resolution fixed  
Status closed   Product Version 1.4.x
Summary 0001171: warning: empty body in an if-statement
Description i tryed to precompile the Busybox for Mipsel. The precompiled abourt at :

  CC applets/applets.o
cc1: warnings being treated as errors
applets/applets.c: In function 'run_applet_by_name':
applets/applets.c:474: warning: empty body in an if-statement
make[2]: *** [applets/applets.o] Fehler 1
make[1]: *** [applets] Fehler 2
make[1]: Leaving directory `/home/bofh/ds-0.2.9_26-13/source/ref-8mb_26/busybox-1.4.0'
make: *** [source/ref-8mb_26/busybox-1.4.0/busybox] Fehler 2

Additional Information snaplet
472{
473 if (ENABLE_FEATURE_SUID_CONFIG)
474 parse_config_file();

        if (!strncmp(name, "busybox", 7))
                exit(busybox_main(argc, argv));
        /* Do a binary search to find the applet entry given the name. */
        applet_using = find_applet_by_name(name);
        if (applet_using) {
                applet_name = applet_using->name;
                if (argc == 2 && !strcmp(argv[1], "--help"))
                        bb_show_usage();
                if (ENABLE_FEATURE_SUID)
                        check_suid(applet_using);
                exit(applet_using->main(argc, argv));
        }
}
Attached Files

- Relationships

- Notes
(0002036)
andreasz
01-23-07 05:05

sorry wrong Category, its my first Report
 
(0002037)
vda
01-23-07 12:38

Find this place:

#else
#define parse_config_file()
#endif /* CONFIG_FEATURE_SUID_CONFIG */

and add "((void)0)":

#else
#define parse_config_file() ((void)0)
#endif /* CONFIG_FEATURE_SUID_CONFIG */

Does this work?
 
(0002039)
andreasz
01-24-07 04:35

Hello, ist works thank you but now a new error or must i report it as a new ?:

 CC archival/tar.o
cc1: warnings being treated as errors
archival/tar.c: In function 'writeFileToTarball':
archival/tar.c:379: warning: unused parameter 'depth'
make[2]: *** [archival/tar.o] Fehler 1
make[1]: *** [archival] Fehler 2
make[1]: Leaving directory `/home/bofh/ds-0.2.9_26-13/source/ref-8mb_26/busybox-1.4.0'
make: *** [source/ref-8mb_26/busybox-1.4.0/busybox] Fehler 2
 
(0002040)
vda
01-24-07 12:33

Add ATTRIBUTE_UNUSED here:

static int writeFileToTarball(const char *fileName, struct stat *statbuf,
                        void *userData, int depth ATTRIBUTE_UNUSED)

Pity, my gcc doesn't emit this warning...
 
(0002045)
andreasz
01-25-07 13:23

it works, thank you
 
(0002046)
bernhardf
01-25-07 15:59

vda,
Re: Pity, my gcc doesn't emit this warning...

Try make EXTRA_CFLAGS="-Wunused -W"
This will warn about empty bodies.

One common thing can be caught with -Wnested-externs

Another related thing:
With gcc-4.3 (trunk), i noticed:
archival/libunarchive/get_header_tar.c: In function 'get_header_tar':
archival/libunarchive/get_header_tar.c:140: warning: array subscript is above array bounds
archival/libunarchive/get_header_tar.c:155: warning: array subscript is above array bounds
archival/libunarchive/get_header_tar.c:158: warning: array subscript is above array bounds

util-linux/fsck_minix.c: In function 'map_block2':
util-linux/fsck_minix.c:500: warning: array subscript is above array bounds


What bothers me much, much more, is that current svn is entering more and more into lala land.
Please override that *wrong* -std=gnu99 by explicitely requesting c99:

 make EXTRA_CFLAGS="-Wunused -std=c99"

We currently don't even compile with a C99 compiler (gcc-4.1 in that case) anymore:
  CC libbb/xatonum.o
In file included from libbb/xatonum.c:10:
include/libbb.h:297: warning: declaration does not declare anything
  CC libbb/xconnect.o
In file included from libbb/xconnect.c:10:
include/libbb.h:297: warning: declaration does not declare anything
libbb/xconnect.c: In function 'get_nport':
libbb/xconnect.c:88: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c:89: error: 'len_and_sockaddr' has no member named 'sin6'
libbb/xconnect.c:92: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c:93: error: 'len_and_sockaddr' has no member named 'sin'
libbb/xconnect.c: In function 'set_nport':
libbb/xconnect.c:102: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c:103: error: 'len_and_sockaddr' has no member named 'sin6'
libbb/xconnect.c:107: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c:108: error: 'len_and_sockaddr' has no member named 'sin'
libbb/xconnect.c: In function 'str2sockaddr':
libbb/xconnect.c:165: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c:167: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c: In function 'xsocket_stream':
libbb/xconnect.c:210: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c:212: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c: In function 'create_and_bind_stream_or_die':
libbb/xconnect.c:228: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c:234: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c: In function 'create_and_connect_stream_or_die':
libbb/xconnect.c:248: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c:250: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c: In function 'xconnect_stream':
libbb/xconnect.c:257: error: 'len_and_sockaddr' has no member named 'sa'
libbb/xconnect.c:258: error: 'len_and_sockaddr' has no member named 'sa'
make[1]: *** [libbb/xconnect.o] Error 1
make: *** [libbb] Error 2

I'm not arguing that we have to strictly adhere to C89, but a pure C99 compiler should be able to cope with busybox, IMNSHO

cheers,
 
(0002047)
bernhardf
01-25-07 16:05

andreasz, I have corrected the category.
Thanks for your report!
 
(0002054)
vda
01-26-07 17:49

Bernhard, can we discuss it in ml? bug database isn't very suitable for this...
 

- Issue History
Date Modified Username Field Change
01-23-07 05:04 andreasz New Issue
01-23-07 05:04 andreasz Status new => assigned
01-23-07 05:04 andreasz Assigned To  => BusyBox
01-23-07 05:05 andreasz Note Added: 0002036
01-23-07 12:38 vda Note Added: 0002037
01-23-07 12:38 vda Status assigned => feedback
01-24-07 04:35 andreasz Note Added: 0002039
01-24-07 12:33 vda Note Added: 0002040
01-25-07 13:23 andreasz Note Added: 0002045
01-25-07 15:59 bernhardf Note Added: 0002046
01-25-07 16:01 bernhardf Status feedback => assigned
01-25-07 16:01 bernhardf Assigned To BusyBox => vda
01-25-07 16:03 bernhardf Severity minor => block
01-25-07 16:03 bernhardf Category Kernel Module Support => Standards Compliance
01-25-07 16:05 bernhardf Note Added: 0002047
01-26-07 17:49 vda Note Added: 0002054
06-16-07 16:20 vda Status assigned => closed
06-16-07 16:20 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker