From: Mike Frysinger <vapier@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] new warnings to catch from gcc in portage
Date: Sun, 20 Jun 2010 05:26:38 -0400 [thread overview]
Message-ID: <201006200526.39160.vapier@gentoo.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1544 bytes --]
the newer fortify/security work in gcc provides some nice checks which portage
doesnt currently flag. those are:
": warning: array subscript is below array bounds$"
": warning: array subscript is above array bounds$"
": warning: attempt to free a non-heap object"
": warning: .* called with .*bigger.* than .* destination buffer$"
": warning: call to .* will always overflow destination buffer$"
this should catch the kind of checks where people check for pointer math
overflow but dont realize that gcc optimizes it away:
": warning: assuming pointer wraparound does not occur when comparing "
these tend to be typos in code:
": warning: hex escape sequence out of range$"
": warning: [^ ]*-hand operand of comma .*has no effect$"
these too are typos/thinkos involving NULL instead of a value of 0, or
misordering of arguments:
": warning: converting to non-pointer type .* from NULL"
": warning: NULL used in arithmetic$"
": warning: passing NULL to non-pointer argument"
these tend to be thinkos which result in incorrect behavior:
": warning: the address of [^ ]* will always evaluate as"
": warning: the address of [^ ]* will never be NULL"
think "char foo[1234]" and later doing "if (foo) ..."
i cant see this being valid:
": warning: too few arguments for format"
or trying to return addresses to function locals:
": warning: reference to local variable .* returned"
": warning: returning reference to temporary"
": warning: function returns address of local variable"
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next reply other threads:[~2010-06-20 9:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-20 9:26 Mike Frysinger [this message]
2010-07-19 21:22 ` [gentoo-dev] new warnings to catch from gcc in portage Mike Frysinger
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=201006200526.39160.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gentoo-dev@lists.gentoo.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