Selectively disable -Warray-bounds

This commit is contained in:
Tim Angus 2025-07-14 17:40:33 +01:00
parent 2dc5fc674e
commit abc448faec
2 changed files with 24 additions and 0 deletions

View File

@ -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

View File

@ -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