Skip to content

Commit 7a5e5c9

Browse files
committed
Selectively disable -Warray-bounds
1 parent 2dc5fc6 commit 7a5e5c9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

code/renderergl1/tr_sky.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ static vec3_t sky_clip[6] =
4949
static float sky_mins[2][6], sky_maxs[2][6];
5050
static float sky_min, sky_max;
5151

52+
#ifdef __GNUC__
53+
#pragma GCC diagnostic push
54+
// AddSkyPolygon and ClipSkyPolygon both technically do
55+
// unbounded access of their vecs parameter, though in
56+
// practice the size of what they're passed makes it safe
57+
#pragma GCC diagnostic ignored "-Warray-bounds"
58+
#endif
59+
5260
/*
5361
================
5462
AddSkyPolygon
@@ -238,6 +246,10 @@ static void ClipSkyPolygon (int nump, vec3_t vecs, int stage)
238246
ClipSkyPolygon (newc[1], newv[1][0], stage+1);
239247
}
240248

249+
#ifdef __GNUC__
250+
#pragma GCC diagnostic pop
251+
#endif
252+
241253
/*
242254
==============
243255
ClearSkyBox

0 commit comments

Comments
 (0)