Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

fix compiler warning in micro-ECC: ISO C90 forbids mixed declarations and code #4679

Closed
wzdev-ci opened this issue Dec 7, 2017 · 5 comments

Comments

@wzdev-ci
Copy link
Contributor

wzdev-ci commented Dec 7, 2017

resolution_fixed type_patch (an actual patch, not a request for one) | by Forgon


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.


Issue migrated from trac:4679 at 2022-04-16 12:57:51 -0700

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 7, 2017

Forgon uploaded file iso_c90.patch (1.2 KiB)

patch file created with git format-patch

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 7, 2017

Forgon2100 <forgon2100@...> changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 7, 2017

Forgon2100 <forgon2100@...> changed owner from `` to Forgon2100 <forgon2100@gmail.com>

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 7, 2017

Forgon2100 <forgon2100@...> changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 7, 2017

Forgon2100 <forgon2100@...> commented


In Warzone2100/warzone2100@b616a06:

#CommitTicketReference repository="" revision="b616a06141e7eab1379334a80fe93f5a6ffef450"
fixes #4679: fix compiler warning in micro-ECC: ISO C90 forbids mixed declarations and code

@wzdev-ci wzdev-ci closed this as completed Dec 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant