From 5509e2e13e12969616599e7330bbcfba0c952085 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Fri, 27 Sep 2019 22:08:15 +1000 Subject: [PATCH] Resolve gcc -Wshadow / MS C4456 compilation warning(s) --- auto/src/glew_init_gl.c | 8 +++++--- config/Makefile.linux | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/auto/src/glew_init_gl.c b/auto/src/glew_init_gl.c index b28013f..d3b0914 100644 --- a/auto/src/glew_init_gl.c +++ b/auto/src/glew_init_gl.c @@ -79,7 +79,6 @@ static GLenum GLEWAPIENTRY glewContextInit () const GLubyte* s; GLuint dot; GLint major, minor; - size_t n; #ifdef _WIN32 getString = glGetString; @@ -130,8 +129,11 @@ static GLenum GLEWAPIENTRY glewContextInit () GLEW_VERSION_1_1 = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; } - for (n = 0; n < sizeof(_glewExtensionString) / sizeof(_glewExtensionString[0]); ++n) - _glewExtensionString[n] = GL_FALSE; + { + size_t i; + for (i = 0; i < sizeof(_glewExtensionString) / sizeof(_glewExtensionString[0]); ++i) + _glewExtensionString[i] = GL_FALSE; + } if (GLEW_VERSION_3_0) { diff --git a/config/Makefile.linux b/config/Makefile.linux index 5263ada..694a98d 100644 --- a/config/Makefile.linux +++ b/config/Makefile.linux @@ -23,7 +23,9 @@ LDFLAGS.GL = -lGL -lX11 LDFLAGS.STATIC = -Wl,-Bstatic LDFLAGS.DYNAMIC = -Wl,-Bdynamic NAME = GLEW -WARN = -Wall -W +WARN += -Wall -W +WARN += -Wshadow +WARN += -pedantic POPT = -O2 CFLAGS.EXTRA += -fPIC CFLAGS.EXTRA += -Wcast-qual