Skip to content

Commit df46de0

Browse files
committed
Update g++ warning flags
1 parent a777d25 commit df46de0

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
CFLAGS = -pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy \
2-
-Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op \
3-
-Wmissing-include-dirs -Wnoexcept \
4-
-Woverloaded-virtual -Wredundant-decls -Wshadow \
5-
-Wsign-conversion -Wsign-promo -Wstrict-null-sentinel \
6-
-Wswitch-default -Wundef -Werror -Wno-unused
7-
8-
# these are annoying
9-
# -Wmissing-declarations -Wold-style-cast
1+
CFLAGS = -Wall -Wextra -Werror -Wpedantic -Wshadow -Wconversion -Wno-float-conversion -Wno-unused-parameter -O2
102

113
LDFLAGS = -lGLEW -lGL -lGLU -lglfw
124

src/shader.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ Shader::Shader(const char *vertexPath, const char *fragmentPath) {
2222
int success;
2323
glGetShaderiv(ID, GL_LINK_STATUS, &success);
2424
if (!success) {
25-
GLint maxLength;
26-
glGetProgramiv(ID, GL_INFO_LOG_LENGTH, &maxLength);
27-
GLchar infoLog(maxLength);
28-
glGetProgramInfoLog(ID, maxLength, &maxLength, &infoLog);
25+
GLchar infoLog[1024];
26+
glGetProgramInfoLog(ID, 1024, NULL, infoLog);
2927
std::cerr << "ERROR: SHADER LINKING FAILED\n" << infoLog << std::endl;
3028
}
3129

0 commit comments

Comments
 (0)