Pārlūkot izejas kodu

Disable spurious conversion warning for GCC

bel2125 8 gadi atpakaļ
vecāks
revīzija
4928bbbcd4
1 mainītis faili ar 11 papildinājumiem un 1 dzēšanām
  1. 11 1
      src/civetweb.c

+ 11 - 1
src/civetweb.c

@@ -9385,7 +9385,17 @@ mg_websocket_write_exec(struct mg_connection *conn,
 
 	int retval = -1;
 
-	header[0] = 0x80u | (opcode & 0xf);
+#if defined(__GNUC__) || defined(__MINGW32__)
+/* Disable spurious conversion warning for GCC */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+#endif
+
+	header[0] = 0x80u | (unsigned char)((unsigned)opcode & 0xf);
+
+#if defined(__GNUC__) || defined(__MINGW32__)
+#pragma GCC diagnostic pop
+#endif
 
 	/* Frame format: http://tools.ietf.org/html/rfc6455#section-5.2 */
 	if (dataLen < 126) {