#208 ✓resolved
mischi

warning in ideviceinstaller.c on Mac OS X

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

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

Comments and changes to this ticket

  • mischi

    mischi March 22nd, 2011 @ 02:19 PM

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

  • Martin S.

    Martin S. March 23rd, 2011 @ 10:33 AM

    • 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?

  • mischi

    mischi March 23rd, 2011 @ 06:35 PM

    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

  • Martin S.

    Martin S. March 26th, 2011 @ 10:26 AM

    • 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.

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A project around supporting the iPhone in Linux.

See http://libimobiledevice.org

People watching this ticket

Tags

Pages