Menu

#6 Does not compile (with GCC 4.6.0)

open
nobody
None
5
2014-02-07
2011-04-07
No

$ make
cc -Wall -Werror -c -o mp3_check.o mp3_check.c
cc -Wall -Werror -c -o mp3_check_misc.o mp3_check_misc.c
In file included from mp3_check_misc.c:11:0:
support_functions.h: In function ‘print_frame_info’:
support_functions.h:683:2: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Werror=format]
mp3_check_misc.c: In function ‘scan_file’:
mp3_check_misc.c:57:7: error: variable ‘found_weak_header’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

make: *** [mp3_check_misc.o] Error 1

Discussion

  • Daniel

    Daniel - 2011-09-27

    Get the same error, when i will build it under 64bit...

    My GCC Version is

    gcc --version
    gcc (GCC) 4.5.2
    Copyright (C) 2010 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    Thankf for efforts

     
  • DrCore

    DrCore - 2014-02-07

    Change line 683 into:
    printf("%-20s%zu\n", "BinLen", strlen(mp3_i->BIN_STRING));

    (use %zu is the right formatter for size_t variables)

    Unfortunately that still does not allow it to compile as is:
    mp3_check_misc.c: In function ‘scan_file’:
    mp3_check_misc.c:57:7: error: variable ‘found_weak_header’ set but not used [-Werror=unused-but-set-variable]
    char found_weak_header = NO;
    ^
    cc1: all warnings being treated as errors
    make: *** [mp3_check_misc.o] Error 1

    Second fix is to either remove all lines with found_weak_header (it is set but never tested) or change the Makefile and remove -Werror in CFLAGS.

     
    • Dylan

      Dylan - 2014-07-28

      You can alternately just remove the -Wall and -Werror flags from the makefile.

       

Log in to post a comment.