On Tue, Jun 5, 2012 at 3:26 PM, Andreas Fritiofson <[email protected]> wrote: > On Tue, Jun 5, 2012 at 8:03 AM, Vaclav Peroutka <[email protected]> wrote: >>> > >>> > libtool: compile: i586-mingw32msvc-gcc -std=gnu99 -DHAVE_CONFIG_H -I. >>> -I../../.. -I../../../src -I../../../src -I../../../src/helper >>> -DPKGDATADIR=\"/usr/local/share/openocd\" >>> -DPKGLIBDIR=\"/usr/local/lib/openocd\" >>> -I../../../jimtcl -I../../../jimtcl -g -O2 -D__USE_MINGW_ANSI_STDIO >>> -I/home/vaclavpe/temp/libftd2xx -Wall -Wstrict-prototypes -Wformat-security >>> -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align >>> -Wredundant-decls -Werror -MT cfi.lo -MD -MP -MF .deps/cfi.Tpo -c cfi.c -o >>> cfi.o >>> > cc1: warnings being treated as errors >>> > cfi.c: In function 'cfi_spansion_write_block': >>> > cfi.c:1821: warning: dereferencing type-punned pointer will break >>> strict-aliasing rules >>> >>> Probably something in the code that triggers this warning in certain >>> compilers/environments. Have you looked at the code to see if there >>> really is something fishy going on? >>> >> What mingw-w64 gcc version do you use ? The problem I discovered is >> described here: >> http://blog.worldofcoding.com/2010/02/solving-gcc-44-strict-aliasing-problems.html > > The one in the ubuntu 12.04 repo. GCC 4.6.something. > apt-get install mingw-w64 > >> >> The affected line contains casting of incompatible pointer types (from >> armv7m_algorithm to arm_algorithm). That is the problem. "-Werror" parameter >> of gcc causes that the warning is treated as error and compilation stops. >> >> I temporarily removed this Werror parameter and compilation goes further. >> But honestly, better solution will be to somehow unify arm algorithm >> structures. I am not sure if I am able to fix that. >> >> Can you check, which parameters mingw-w64 gcc does use ? Why you do not have >> such error or even warning ? > > I don't know if it's a problem with the rather outdated GCC version > mingw32 is based on. I build with default settings, that is with > -Werror. Have never seen a warning in that piece of code, not for > native build, not when cross compiling. I'll have a look at the code > if I find the time.
Just checked and it is truly a nasty cast. At least it's likely to produce the correct result. I should be easy to clean up the code enough to remove the warning. If no one else bothers, I'll do it if I remember to. /Andreas ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
