[PATCH] applet volname

Matthew Stoltenberg d3matt at gmail.com
Wed Aug 12 23:52:15 UTC 2009


On Wed, Aug 12, 2009 at 6:00 PM, Denys Vlasenko<vda.linux at googlemail.com> wrote:
> On Wed, Aug 12, 2009 at 8:33 PM, Matthew Stoltenberg<d3matt at gmail.com> wrote:
>> +int volname_main(int argc, char *argv[])
>> +{
>> +       int fd;
>> +       int status;
>> +       char *device;
>> +       char buffer[33];
>> +
>> +       if (argc == 2) {
>> +               device = argv[1];
>
> cc1: warnings being treated as errors
> miscutils/volname.c:33: error: no previous prototype for 'volname_main'
> miscutils/volname.c: In function 'volname_main':
> miscutils/volname.c:39: error: assignment discards qualifiers from
> pointer target type
>
> You need to try to eliminate all warnings
> before you submit your code.
>
> I applied your code with some edits. Thanks.
> --
> vda
>

Sorry about that.  I thought I had warnings turned on (was initially
testing this in a goofy cross-compile system at work).  See attached
for updates with warning fix.

Here's successful compile: with -Wall
[ mstolten at flash-ubuntu ~/Download/busybox-1.14.3  :) ] $ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.3.3-5ubuntu4'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--enable-mpfr --enable-targets=all --with-tune=generic
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu
Thread model: posix
gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)
[ mstolten at flash-ubuntu ~/Download/busybox-1.14.3  :) ] $ rm miscutils/volname.o
[ mstolten at flash-ubuntu ~/Download/busybox-1.14.3  :) ] $ CFLAGS=-Wall make
  CC      miscutils/volname.o
  AR      miscutils/lib.a
  LINK    busybox_unstripped
Trying libraries: crypt m
 Library crypt is not needed, excluding it
 Library m is not needed, excluding it
Final link with: <none>

Also, using on my box...
[ mstolten at flash-ubuntu ~/Download/busybox-1.14.3  :) ] $ ./busybox volname
BABYLON5_SEASON4_DISC3


Lastly, the online FAQ could use an update to avoid the "no previous
prototype" warning.

Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: volname_patch2-1.14.3.patch
Type: text/x-patch
Size: 3513 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090812/99301608/attachment.bin>


More information about the busybox mailing list