From 5b29f1cdec29b00fbdd2a2c720615bfee00f536a Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Tue, 17 Feb 2015 22:43:07 +0100 Subject: [PATCH] PPP, CORE, Fixed warning with PPP_PROTOCOLNAME enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lwip/src/netif/ppp/ppp.c: In function ‘ppp_input’: lwip/src/netif/ppp/ppp.c:769:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic] const char *pname = protocol_name(protocol); ^ --- src/netif/ppp/ppp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index 824bdeeb..da806a9c 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -654,6 +654,9 @@ void ppp_link_end(ppp_pcb *pcb) { */ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) { u16_t protocol; +#if PPP_DEBUG && PPP_PROTOCOLNAME + const char *pname; +#endif /* PPP_DEBUG && PPP_PROTOCOLNAME */ protocol = (((u8_t *)pb->payload)[0] << 8) | ((u8_t*)pb->payload)[1]; @@ -766,7 +769,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) { #if PPP_DEBUG #if PPP_PROTOCOLNAME - const char *pname = protocol_name(protocol); + pname = protocol_name(protocol); if (pname != NULL) { ppp_warn("Unsupported protocol '%s' (0x%x) received", pname, protocol); } else