diff --git a/code/renderergl1/tr_sky.c b/code/renderergl1/tr_sky.c index 2f5f7786..304d01ea 100644 --- a/code/renderergl1/tr_sky.c +++ b/code/renderergl1/tr_sky.c @@ -49,6 +49,14 @@ static vec3_t sky_clip[6] = static float sky_mins[2][6], sky_maxs[2][6]; static float sky_min, sky_max; +#ifdef __GNUC__ +#pragma GCC diagnostic push +// AddSkyPolygon and ClipSkyPolygon both technically do +// unbounded access of their vecs parameter, though in +// practice the size of what they're passed makes it safe +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif + /* ================ AddSkyPolygon @@ -238,6 +246,10 @@ static void ClipSkyPolygon (int nump, vec3_t vecs, int stage) ClipSkyPolygon (newc[1], newv[1][0], stage+1); } +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + /* ============== ClearSkyBox diff --git a/code/renderergl2/tr_sky.c b/code/renderergl2/tr_sky.c index c79f48f5..fee9e685 100644 --- a/code/renderergl2/tr_sky.c +++ b/code/renderergl2/tr_sky.c @@ -49,6 +49,14 @@ static vec3_t sky_clip[6] = static float sky_mins[2][6], sky_maxs[2][6]; static float sky_min, sky_max; +#ifdef __GNUC__ +#pragma GCC diagnostic push +// AddSkyPolygon and ClipSkyPolygon both technically do +// unbounded access of their vecs parameter, though in +// practice the size of what they're passed makes it safe +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif + /* ================ AddSkyPolygon @@ -238,6 +246,10 @@ static void ClipSkyPolygon (int nump, vec3_t vecs, int stage) ClipSkyPolygon (newc[1], newv[1][0], stage+1); } +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + /* ============== ClearSkyBox