From: Andy Green Date: Wed, 16 Jan 2013 02:21:34 +0000 (+0800) Subject: workaround for some gcc array bounds false positive X-Git-Tag: accepted/2.0/20130307.220733~253 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32e2815344d8132c39ffbdc4fa53a41177781b76;p=profile%2Fivi%2Flibwebsockets.git workaround for some gcc array bounds false positive Signed-off-by: Andy Green --- diff --git a/test-server/test-server.c b/test-server/test-server.c index 5936beb..620c6f2 100644 --- a/test-server/test-server.c +++ b/test-server/test-server.c @@ -252,11 +252,18 @@ static int callback_http(struct libwebsocket_context *context, * old end guy goes into vacant slot in hash table */ +/* some versions of gcc see a false positive here, workaround */ +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif pollfd_count[hash]--; if (pollfd_count[hash]) { pollfd_maps[hash][n].index = pollfd_maps[hash][pollfd_count[hash]].index; pollfd_maps[hash][n].fd = pollfd_maps[hash][pollfd_count[hash]].fd; } +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif break; case LWS_CALLBACK_SET_MODE_POLL_FD: