[ipxe-devel] [PATCH 1/2] make variables const

Christian Hesse list at eworm.de
Thu Apr 23 11:33:25 UTC 2015


From: Christian Hesse <mail at eworm.de>

This fixes "initialization discards 'const' qualifier from pointer
target type" with GCC 5.1.0.

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 src/net/tls.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/net/tls.c b/src/net/tls.c
index 30ccc93..a974f28 100644
--- a/src/net/tls.c
+++ b/src/net/tls.c
@@ -1637,9 +1637,9 @@ static int tls_new_handshake ( struct tls_session *tls,
 			uint8_t length[3];
 			uint8_t payload[0];
 		} __attribute__ (( packed )) *handshake = data;
-		void *payload = &handshake->payload;
-		size_t payload_len = tls_uint24 ( handshake->length );
-		void *next = ( payload + payload_len );
+		const void *payload = &handshake->payload;
+		const size_t payload_len = tls_uint24 ( handshake->length );
+		const void *next = ( payload + payload_len );
 
 		/* Sanity check */
 		if ( next > end ) {
-- 
2.3.6




More information about the ipxe-devel mailing list