Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

warning in ideviceinstaller.c on Mac OS X

#208

When compiling on Mac OS X a simple ./configure make breaks with this error because the gcc default is -Werror:

Making all in src
CC ideviceinstaller-ideviceinstaller.o cc1: warnings being treated as errors
ideviceinstaller.c: In function ‘zip_f_get_contents’:
ideviceinstaller.c:165: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘off_t’
ideviceinstaller.c: In function ‘main’:
ideviceinstaller.c:602: warning: implicit declaration of function ‘basename’
make[2]: [ideviceinstaller-ideviceinstaller.o] Error 1
make[1]:
[all-recursive] Error 1
make: *** [all] Error 2

a quick fix is ./configure with CFLAGS='-Wno-error' does the trick, but maybe it can be really fixed.

I am not much of a C expert, but replacing "%ld" by "%lld" solved the first warning.

After some googling I "fixed" the second warning with #include <libgen.h>, but I have no idea about this. Someone. who knows what this is about, must check this.

All the best - Michael Schindler aka MiSchi

Reported by mischi · March 20th, 2011 @ 11:00 PM

State: resolved
Milestone: none
Assigned to: Martin S. Martin S.

Activity

  1. mischi
    mischi

    the same fix (#include <libgen.h>) should be also applied to libimobiledevice-1.0.4/tools/ideviceimagemounter.c

    March 22nd, 2011 @ 02:19 PM

  2. Martin S.
    Martin S.
    • Tag set to mac os x
    • State changed from new to open
    • Milestone set to 1.2.0 Release
    • Assigned user set to Martin S.
    • Milestone order changed from 190916 to 0

    Thanks, I have a fix for the printf issue and adding the libgen.h seems right.

    However, I am now wondering a bit since we never had the issue in libimobiledevice when compiling on Mac OS X.

    How do you compile this and on which OS and Xcode version?

    March 23rd, 2011 @ 10:33 AM

  3. mischi
    mischi

    This is with 10.6.6 and XCode 3.2.6. In the end, the compilation is done within fink, but IIRC, it also showed up, when building on a "plain" commandline. I forgot, when exactly and with which version the default option for gcc was changed from -Wno-error to -Werror. My guess is something like a year ago or so.

    Michael

    March 23rd, 2011 @ 06:35 PM

  4. Martin S.
    Martin S.
    • State changed from open to resolved
    • Milestone cleared.

    Ok, thanks, well whatever I pushed fixes to git master of ideviceinstaller and libimobiledevice.

    Please reopen if those do not fix your issue.

    March 26th, 2011 @ 10:26 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.