From: Liu Hao <lh_mouse@126.com>
To: Jonny Grant <jg@jguk.org>,
Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: gcc warn when pointers not checked non-null before de-referencing.
Date: Fri, 18 Jun 2021 16:38:50 +0800 [thread overview]
Message-ID: <e053fa8b-5cac-91d9-ced8-0147afd9ae5b@126.com> (raw)
In-Reply-To: <ffa2f90f-e1c9-4dc7-8f42-fddd1229063b@jguk.org>
[-- Attachment #1.1: Type: text/plain, Size: 576 bytes --]
在 2021-06-18 04:44, Jonny Grant 写道:
>
> Hello
> Thank you for the suggestion, yes, I had used that before. I did just check, it's runtime checks. I had hoped for something at compile time. warning for every function that didn't check pointer for NULL before de-referencing.
>
You might want to have a look at <http://cppcheck.sourceforge.net/demo/>. There are some 'NULL
pointers' examples which answers your exact question.
If you use Debian or Ubuntu, you can install cppcheck with `sudo aptitude install cppcheck`.
--
Best regards,
Liu Hao
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2021-06-18 8:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-13 22:30 Jonny Grant
2021-06-14 5:15 ` Xi Ruoyao
2021-06-16 13:01 ` Jonny Grant
2021-06-16 13:36 ` Xi Ruoyao
2021-07-03 15:36 ` Jonny Grant
2021-07-06 15:39 ` Xi Ruoyao
2021-07-19 18:20 ` Jonny Grant
2021-06-16 17:59 ` Segher Boessenkool
2021-06-17 20:44 ` Jonny Grant
2021-06-18 4:16 ` Xi Ruoyao
2021-07-03 14:14 ` Jonny Grant
2021-07-03 16:22 ` Segher Boessenkool
2021-07-06 10:33 ` Jonny Grant
2021-06-18 8:38 ` Liu Hao [this message]
2021-06-18 14:53 ` Segher Boessenkool
2021-06-14 15:19 ` Martin Sebor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e053fa8b-5cac-91d9-ced8-0147afd9ae5b@126.com \
--to=lh_mouse@126.com \
--cc=gcc-help@gcc.gnu.org \
--cc=jg@jguk.org \
--cc=segher@kernel.crashing.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).