#237 ✓resolved
Pierre Muller

Allow compilation with CFLAGS="-Wall -Werror" for mingw32.

Reported by Pierre Muller | August 9th, 2011 @ 10:42 AM | in 1.2.0 (closed)

Using CFLAGS="-Wall -Werror" for mingw32, I get one error:
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../yasm -Wall -Werror -MT elf.o -MD -MP
-MF .deps/elf.Tpo -c -o elf.o test -f 'modules/objfmts/elf/elf.c' || echo '../ yasm/'modules/objfmts/elf/elf.c
cc1.exe: warnings being treated as errors
../yasm/modules/objfmts/elf/elf.c: In function 'elf_set_arch': ../yasm/modules/objfmts/elf/elf.c:102:34: error: passing argument 3 of 'yasm_sym rec_add_data' discards qualifiers from pointer target type
../yasm/libyasm/symrec.h:425:6: note: expected 'void ' but argument is of type 'const struct elf_machine_ssym * const' make[2]: [elf.o] Error 1
make[2]: Leaving directory /usr/local/src/yasm/build-mingw32-norm' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/usr/local/src/yasm/build-mingw32-norm'
* [all] Error 2

Easily solved with this patch:

$ cat fix-qualifier-warning.patch diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c
old mode 100644
new mode 100755
index acd83d4..57c703f
--- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -99,7 +99,7 @@ elf_set_arch(yasm_arch arch, yasm_symtab symtab, int bits_pref)

                                                 NULL, 0, 0);
         yasm_symrec_add_data(elf_ssyms[i], &elf_ssym_symrec_data,
  •                           &elf_march->ssyms[i]);
  •                           (void *) &elf_march->ssyms[i]);


Could you also apply this patch?

Thanks in advance,

Pierre Muller

Comments and changes to this ticket

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 ยป

The Yasm Modular Assembler Project

Shared Ticket Bins

People watching this ticket