Skip to content

Commit fafcc86

Browse files
authored
Fix new compile warning/error in glbook examples. NFC (#17509)
Recent versions of clang now generate this warning: ``` Chapter_9/TextureWrap/TextureWrap.c:207:59: error: incompatible integer to pointer conversion passing 'unsigned long' to parameter of type 'const void *' [-Wint-conversion] GL_FALSE, 6 * sizeof(GLfloat), 4 * sizeof(GLfloat) ); ```
1 parent 409e0ce commit fafcc86

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

tests/test_browser.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,8 @@ def test_glgears_deriv(self):
17691769

17701770
@requires_graphics_hardware
17711771
def test_glbook(self):
1772-
self.emcc_args.remove('-Werror')
1772+
self.emcc_args.append('-Wno-int-conversion')
1773+
self.emcc_args.append('-Wno-pointer-sign')
17731774
programs = self.get_library('third_party/glbook', [
17741775
Path('Chapter_2/Hello_Triangle', 'CH02_HelloTriangle.o'),
17751776
Path('Chapter_8/Simple_VertexShader', 'CH08_SimpleVertexShader.o'),

tests/third_party/glbook/Makefile

+11-11
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ clean:
3737
find . -name "CH??_*" | xargs rm -f
3838

3939
Chapter_2/Hello_Triangle/CH02_HelloTriangle.o: ${COMMONSRC} ${COMMONHDR} ${CH02SRC}
40-
$(CC) ${COMMONSRC} ${CH02SRC} -r -o $@ ${INCDIR} ${LIBS}
40+
$(CC) ${CFLAGS} ${COMMONSRC} ${CH02SRC} -r -o $@ ${INCDIR} ${LIBS}
4141
Chapter_8/Simple_VertexShader/CH08_SimpleVertexShader.o: ${COMMONSRC} ${COMMONHDR} ${CH08SRC}
42-
$(CC) ${COMMONSRC} ${CH08SRC} -r -o ./$@ ${INCDIR} ${LIBS}
42+
$(CC) ${CFLAGS} ${COMMONSRC} ${CH08SRC} -r -o ./$@ ${INCDIR} ${LIBS}
4343
Chapter_9/Simple_Texture2D/CH09_SimpleTexture2D.o: ${COMMONSRC} ${COMMONHDR} ${CH09SRC1}
44-
$(CC) ${COMMONSRC} ${CH09SRC1} -r -o ./$@ ${INCDIR} ${LIBS}
44+
$(CC) ${CFLAGS} ${COMMONSRC} ${CH09SRC1} -r -o ./$@ ${INCDIR} ${LIBS}
4545
Chapter_9/MipMap2D/CH09_MipMap2D.o: ${COMMONSRC} ${COMMONHDR} ${CH09SRC2}
46-
$(CC) ${COMMONSRC} ${CH09SRC2} -r -o ./$@ ${INCDIR} ${LIBS}
46+
$(CC) ${CFLAGS} ${COMMONSRC} ${CH09SRC2} -r -o ./$@ ${INCDIR} ${LIBS}
4747
Chapter_9/Simple_TextureCubemap/CH09_TextureCubemap.o: ${COMMONSRC} ${COMMONHDR} ${CH09SRC3}
48-
$(CC) ${COMMONSRC} ${CH09SRC3} -r -o ./$@ ${INCDIR} ${LIBS}
48+
$(CC) ${CFLAGS} ${COMMONSRC} ${CH09SRC3} -r -o ./$@ ${INCDIR} ${LIBS}
4949
Chapter_9/TextureWrap/CH09_TextureWrap.o: ${COMMONSRC} ${COMMONHDR} ${CH09SRC4}
50-
$(CC) ${COMMONSRC} ${CH09SRC4} -r -o ./$@ ${INCDIR} ${LIBS}
50+
$(CC) ${CFLAGS} ${COMMONSRC} ${CH09SRC4} -r -o ./$@ ${INCDIR} ${LIBS}
5151
Chapter_10/MultiTexture/CH10_MultiTexture.o: ${COMMONSRC} ${COMMONHDR} ${CH10SRC}
52-
$(CC) ${COMMONSRC} ${CH10SRC} -r -o ./$@ ${INCDIR} ${LIBS}
52+
$(CC) ${CFLAGS} ${COMMONSRC} ${CH10SRC} -r -o ./$@ ${INCDIR} ${LIBS}
5353
Chapter_11/Multisample/CH11_Multisample.o: ${COMMONSRC} ${COMMONHDR} ${CH11SRC}
54-
$(CC) ${COMMONSRC} ${CH11SRC} -r -o ./$@ ${INCDIR} ${LIBS}
54+
$(CC) ${CFLAGS} ${COMMONSRC} ${CH11SRC} -r -o ./$@ ${INCDIR} ${LIBS}
5555
Chapter_11/Stencil_Test/CH11_Stencil_Test.o: ${COMMONSRC} ${COMMONHDR} ${CH11SRC2}
56-
$(CC) ${COMMONSRC} ${CH11SRC2} -r -o ./$@ ${INCDIR} ${LIBS}
56+
$(CC) ${CFLAGS} ${COMMONSRC} ${CH11SRC2} -r -o ./$@ ${INCDIR} ${LIBS}
5757
Chapter_13/Noise3D/CH13_Noise3D.o: ${COMMONSRC} ${COMMONHDR} ${CH13SRC1}
58-
$(CC) ${COMMONSRC} ${CH13SRC1} -r -o ./$@ ${INCDIR} ${LIBS}
58+
$(CC) ${CFLAGS} ${COMMONSRC} ${CH13SRC1} -r -o ./$@ ${INCDIR} ${LIBS}
5959
Chapter_13/ParticleSystem/CH13_ParticleSystem.o: ${COMMONSRC} ${COMMONHDR} ${CH13SRC2}
60-
$(CC) ${COMMONSRC} ${CH13SRC2} -r -o ./$@ ${INCDIR} ${LIBS}
60+
$(CC) ${CFLAGS} ${COMMONSRC} ${CH13SRC2} -r -o ./$@ ${INCDIR} ${LIBS}

0 commit comments

Comments
 (0)