[Dev] Asserts? (was: RE: Keyboard issues with Weston and AGL application suite)

Andersson, Gunnar gunnar.x.andersson at volvocars.com
Fri Oct 16 08:10:41 GMT 2015

A more general follow-up

Is there any tool that can instrument C-code to introduce null-pointer checks, say for a subset, like all pointer accesses within the relatively complex structure datatype used in the example below?

Surprisingly I received several personal replies - AFAICT no mailing list on CC?
Public thanks here to those of you who chose to answer off-list.  (And if it was not deliberate, feel free to post your email and my response)
Best Regards
- Gunnar

-----Original Message-----
From: genivi-projects-bounces at lists.genivi.org [mailto:genivi-projects-bounces at lists.genivi.org] On Behalf Of Derek Foreman
Sent: den 15 oktober 2015 19:22
To: Andersson, Gunnar; dev at lists.tizen.org; ivi at lists.tizen.org; genivi-projects at lists.genivi.org; automotive-discussions at lists.linuxfoundation.org; Leon Anavi
Subject: Re: Asserts? (was: RE: Keyboard issues with Weston and AGL application suite)

On 15/10/15 11:26 AM, Andersson, Gunnar wrote:
> This is not really on topic...
> But seeing this issue just reminds me of a question that nags me. 
> Why do people not use asserts in most projects?   Is it considered 
> to be ugly noise, is it not "cool" to use them, ... or what?
> It's just that in a line like the original one (this is just an example)
>    &context->input_method->seat->keyboard->input_method_grab;
> at least my brain *cannot* avoid asking if every pointer is valid...

More information about the Dev mailing list