[Mesa-dev] [PATCH] mesa: fix no return in two format functions
Tobias Klausmann
tobias.johannes.klausmann at mni.thm.de
Mon Jan 19 12:52:08 PST 2015
On 19.01.2015 19:54, Matt Turner wrote:
> On Thu, Jan 15, 2015 at 10:26 AM, Tobias Klausmann
> <tobias.johannes.klausmann at mni.thm.de> wrote:
>> I: Program returns random data in a function E: Mesa
>> no-return-in-nonvoid-function ../../src/mesa/main/format_utils.c:180
>> E: Mesa no-return-in-nonvoid-function
>> ../../src/mesa/main/glformats.c:2714 --- src/mesa/main/format_utils.c
>> | 1 + src/mesa/main/glformats.c | 1 + 2 files changed, 2
>> insertions(+) diff --git a/src/mesa/main/format_utils.c
>> b/src/mesa/main/format_utils.c index eb650a2..caf0880 100644 ---
>> a/src/mesa/main/format_utils.c +++ b/src/mesa/main/format_utils.c @@
>> -176,6 +176,7 @@
>> _mesa_compute_rgba2base2rgba_component_mapping(GLenum baseFormat,
>> uint8_t *map) } default: assert(!"Unexpected base format"); + return
>> false; } } diff --git a/src/mesa/main/glformats.c
>> b/src/mesa/main/glformats.c index 3e913ed..2e16607 100644 ---
>> a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@
>> -2711,4 +2711,5 @@ _mesa_format_from_format_and_type(GLenum format,
>> GLenum type) * format in that case. */ assert(!"Unsupported format");
>> + return MESA_FORMAT_NONE; }
> Replace assert(!"...") with unreachable("...").
Oh the tool is really happy with it, sorry Jan for causing unnecessary
confusion! Patch will follow (which somebody needs to upstream)
Tobias
More information about the mesa-dev
mailing list