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'
make: * [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)
elf_march->ssyms[i].name,
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
-

Peter Johnson August 19th, 2011 @ 05:22 PM
- → State changed from new to resolved
(from [502eebd33964a95cb8d9aa0dfed981679c30f7da]) Fix const warning in elf_machine_ssym usage.
Reported by: Pierre Muller
[#237 state:resolved] https://github.com/yasm/yasm/commit/502eebd33964a95cb8d9aa0dfed9816...
-

Peter Johnson August 27th, 2011 @ 05:04 PM
- → Assigned user set to Peter Johnson
- → Milestone set to 1.2.0
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.
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