#4679: fix compiler warning in micro-ECC: ISO C90 forbids mixed declarations and code -------------------------------------------------+------------------------- Reporter: Forgon | Owner: Type: patch (an actual patch, not a | Status: new request for one) | Milestone: Priority: normal | unspecified Component: other | Version: Keywords: | git/master Blocking: | Blocked By: | Operating System: All | /Non-Specific -------------------------------------------------+------------------------- When compiling with `./autogen.sh && ./configure -disable-debug CFLAGS='-O2 -gstabs -g -g2' CXXFLAGS='-O2 -gstabs -g -g2' && make` using gcc 7.2.1 GNU, make 4.2.1 prints the following warning:
{{{ make[2]: Entering directory '/home/x/warzone2100/3rdparty/micro-ecc' gcc -DHAVE_CONFIG_H -I. -I../.. -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DNDEBUG -DWZ_DATADIR="\"/usr/local/share/warzone2100\"" -DLOCALEDIR="\"/usr/local/share/locale\"" -I../.. -I../../3rdparty -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wcast-align -Wwrite-strings -Wpointer-arith -Wno-format-security -Wno-expansion-to- defined -Wstrict-prototypes -Wdeclaration-after-statement -Wno-switch -Wno-enum-compare -UDEBUG -O2 -gstabs -g -g2 -fPIC -fstack-protector -MT uECC.o -MD -MP -MF .deps/uECC.Tpo -c -o uECC.o uECC.c In file included from uECC.c:84:0: platform-specific.inc: In function ‘default_RNG’: platform-specific.inc:52:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] char *ptr = (char *)dest; ^~~~ }}} This warning also applies to the following line (number 53). The attached patch fixes the problem. -- Ticket URL: <http://developer.wz2100.net/ticket/4679> Warzone 2100 Trac <http://developer.wz2100.net/> The Warzone 2100 Project ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Warzone2100-project mailing list Warzone2100-project@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/warzone2100-project