[Piglit] [PATCH 1/3] android: piglit-vbo.cpp compile error
Tom Gall
tom.gall at linaro.org
Mon Jan 28 17:30:18 PST 2013
arm-linux-androideabi-gcc (GCC) 4.6.x-google 20120106 (prerelease)
external/piglit/tests/util/piglit_ktx.c: In function
'target_to_texture_binding':
external/piglit/tests/util/piglit_ktx.c:761:1: error: control reaches
end of non-void function [-Werror=return-type]
On Mon, Jan 28, 2013 at 7:18 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Mon, Jan 28, 2013 at 5:11 PM, Tom Gall <tom.gall at linaro.org> wrote:
>> Sure, but tell that to the compiler.
>>
>> It is bad form to not have a return at the end of a function which is
>> supposed to return something. The other way perhaps is just knock out
>> the default case and return that. Either way.
>
> % cat t.cpp
> #include <assert.h>
>
> int f(int n) {
> switch (n) {
> case 1:
> return 1;
> default:
> assert(!"FAIL");
> }
> }
>
> % gcc -O2 -Wall -pedantic -Wreturn-type -Wno-return-type -c t.cpp
>
> <no output>
>
> What flags do I have to use to get an error or warning? I tried with
> an without optimization, C and C++, and gcc versions 4.5.4, 4.6.3, and
> 4.7.2.
--
Regards,
Tom
"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
More information about the Piglit
mailing list