public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/
Date: Fri, 26 Sep 2014 02:17:21 +0000 (UTC)	[thread overview]
Message-ID: <1411694533.5346802bc7ca09955020d265b4a15e8ecf67a28f.dol-sen@gentoo> (raw)

commit:     5346802bc7ca09955020d265b4a15e8ecf67a28f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 12 09:26:26 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Sep 26 01:22:13 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5346802b

Update gcc warning checks to work with colored output

Use -W indicators whenever possible, or more flexible regular
expressions so that our checks correctly match output with
-fdiagnostics-color. Also, enable a few extra warnings with some
of the currently used -W flags.

Based on the patch from Ryan Hill <rhill <AT> gentoo.org>.

---
 bin/install-qa-check.d/90gcc-warnings | 85 +++++++++++++++++++++--------------
 1 file changed, 52 insertions(+), 33 deletions(-)

diff --git a/bin/install-qa-check.d/90gcc-warnings b/bin/install-qa-check.d/90gcc-warnings
index ae39485..48c11e4 100644
--- a/bin/install-qa-check.d/90gcc-warnings
+++ b/bin/install-qa-check.d/90gcc-warnings
@@ -13,44 +13,63 @@ gcc_warn_check() {
 			reset_debug=1
 		fi
 		local m msgs=(
-			": warning: dereferencing type-punned pointer will break strict-aliasing rules"
-			": warning: dereferencing pointer .* does break strict-aliasing rules"
-			": warning: implicit declaration of function"
-			": warning: incompatible implicit declaration of built-in function"
-			": warning: is used uninitialized in this function" # we'll ignore "may" and "might"
-			": warning: comparisons like X<=Y<=Z do not have their mathematical meaning"
-			": warning: null argument where non-null required"
-			": 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"
-			": warning: assuming pointer wraparound does not occur when comparing"
-			": warning: hex escape sequence out of range"
-			": warning: [^ ]*-hand operand of comma .*has no effect"
-			": warning: converting to non-pointer type .* from NULL"
-			": warning: NULL used in arithmetic"
-			": warning: passing NULL to non-pointer argument"
-			": warning: the address of [^ ]* will always evaluate as"
-			": warning: the address of [^ ]* will never be NULL"
-			": warning: too few arguments for format"
-			": warning: reference to local variable .* returned"
-			": warning: returning reference to temporary"
-			": warning: function returns address of local variable"
-			": warning: .*\\[-Wsizeof-pointer-memaccess\\]"
-			": warning: .*\\[-Waggressive-loop-optimizations\\]"
+			# only will and does, no might :)
+			'warning: .*will.*\[-Wstrict-aliasing\]'
+			'warning: .*does.*\[-Wstrict-aliasing\]'
+			# implicit declaration of function ‘...’
+			'warning: .*\[-Wimplicit-function-declaration\]'
+			# with -Wall, goes in pair with -Wimplicit-function-declaration
+			# but without -Wall, we need to assert for it alone
+			'warning: .*incompatible implicit declaration of built-in function'
+			# 'is used uninitialized in this function' and some more
+			'warning: .*\[-Wuninitialized\]'
+			# comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning
+			'warning: .*mathematical meaning*\[-Wparentheses\]'
+			# null argument where non-null required
+			'warning: .*\[-Wnonnull\]'
+			# array subscript is above/below/outside array bounds
+			'warning: .*\[-Warray-bounds\]'
+			# attempt to free a non-heap object
+			'warning: .*\[-Wfree-nonheap-object\]'
+			# those three do not have matching -W flags, it seems
+			'warning: .*will always overflow destination buffer'
+			'warning: .*assuming pointer wraparound does not occur'
+			'warning: .*escape sequence out of range'
+			# left/right-hand operand of comma expression has no effect
+			'warning: .*comma.*\[-Wunused-value\]'
+			# converting to non-pointer type ... from NULL and likes
+			'warning: .*\[-Wconversion-null\]'
+			# NULL used in arithmetic
+			'warning: .*NULL.*\[-Wpointer-arith\]'
+			# pointer to a function used in arithmetic and likes
+			'warning: .*function.*\[-Wpointer-arith\]'
+			# the address of ... will never be NULL and likes
+			# (uses of function refs & string constants in conditionals)
+			'warning: .*\[-Waddress\]'
+			# outdated?
+			'warning: .*too few arguments for format'
+			# format ... expects a matching ... argument
+			# (iow, too few arguments for format in new wording :))
+			'warning: .*matching.*\[-Wformat=\]'
+			# function returns address of local variable
+			'warning: .*\[-Wreturn-local-addr\]'
+			# argument to sizeof ... is the same expression as the source
+			'warning: .*\[-Wsizeof-pointer-memaccess\]'
+			# iteration invokes undefined behavior
+			'warning: .*\[-Waggressive-loop-optimizations\]'
+
 			# this may be valid code :/
-			#": warning: multi-character character constant"
+			#': warning: multi-character character constant'
 			# need to check these two ...
-			#": warning: assuming signed overflow does not occur when"
-			#": warning: comparison with string literal results in unspecified behav"
+			#': warning: assuming signed overflow does not occur when'
+			#': warning: comparison with string literal results in unspecified behav'
 			# yacc/lex likes to trigger this one
-			#": warning: extra tokens at end of .* directive"
+			#': warning: extra tokens at end of .* directive'
 			# only gcc itself triggers this ?
-			#": warning: .*noreturn.* function does return"
+			#': warning: .*noreturn.* function does return'
 			# these throw false positives when 0 is used instead of NULL
-			#": warning: missing sentinel in function call"
-			#": warning: not enough variable arguments to fit a sentinel"
+			#': warning: missing sentinel in function call'
+			#': warning: not enough variable arguments to fit a sentinel'
 		)
 		local abort="no"
 		local i=0


             reply	other threads:[~2014-09-26  2:17 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26  2:17 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-04-24 22:12 [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/ Sam James
2025-01-06 10:19 Ulrich Müller
2024-09-17 14:32 Matt Turner
2024-09-17 14:32 Matt Turner
2024-09-17 14:32 Matt Turner
2024-09-17 14:32 Matt Turner
2024-09-09 23:49 Sam James
2024-05-22 16:56 Sam James
2024-05-17  6:28 Sam James
2024-04-25  2:59 Mike Gilbert
2023-07-29  3:57 Sam James
2023-06-29  8:22 Sam James
2023-05-11  1:24 Sam James
2023-05-11  1:24 Sam James
2023-05-11  1:24 Sam James
2023-05-11  1:24 Sam James
2023-05-11  1:24 Sam James
2023-05-11  1:24 Sam James
2023-04-07 10:41 Sam James
2023-02-28  3:10 Sam James
2023-02-27  4:43 Sam James
2023-02-26 20:22 Sam James
2023-02-19 12:23 Sam James
2023-02-17  9:12 Sam James
2023-02-17  9:12 Sam James
2022-11-09  2:29 Sam James
2022-11-09  2:25 Sam James
2022-11-09  2:25 Sam James
2022-11-09  2:25 Sam James
2022-11-09  2:25 Sam James
2022-11-09  2:25 Sam James
2022-11-08 23:51 Sam James
2022-10-27 23:37 Sam James
2022-10-27 23:37 Sam James
2022-10-27 23:37 Sam James
2022-10-11 19:18 Sam James
2022-10-11 19:18 Sam James
2022-10-11 19:18 Sam James
2022-08-19  0:09 Sam James
2022-08-14 20:43 Sam James
2022-08-13 17:30 Sam James
2022-08-10  4:36 Sam James
2022-08-10  4:36 Sam James
2022-08-01 22:39 Sam James
2022-08-01 22:39 Sam James
2022-08-01 22:39 Sam James
2022-07-28  6:32 Fabian Groffen
2022-07-27  8:18 Fabian Groffen
2022-07-27  8:18 Fabian Groffen
2022-05-15  1:02 Sam James
2022-05-15  1:02 Sam James
2022-05-07 17:15 Mike Gilbert
2022-04-28 15:50 Sam James
2022-04-12  2:00 Sam James
2022-04-12  2:00 Sam James
2022-04-12  2:00 Sam James
2022-04-12  2:00 Sam James
2022-04-12  2:00 Sam James
2022-04-12  2:00 Sam James
2022-04-12  2:00 Sam James
2022-04-12  2:00 Sam James
2022-04-10 17:20 Sam James
2022-04-05  4:33 Sam James
2019-11-03 20:15 Zac Medico
2019-11-03 20:15 Zac Medico
2019-11-03 20:02 Zac Medico
2019-11-03 19:45 Zac Medico
2019-05-20  5:01 Zac Medico
2019-05-20  4:41 Zac Medico
2018-10-06  1:15 Zac Medico
2018-09-04 21:16 Michał Górny
2018-08-07 18:49 Zac Medico
2018-08-07 18:49 Zac Medico
2018-08-04 19:36 Zac Medico
2018-07-28  6:41 Zac Medico
2018-01-26  6:40 Michał Górny
2017-10-16 17:21 Zac Medico
2017-08-02  7:24 Zac Medico
2016-06-02  6:12 Zac Medico
2016-06-02  1:40 Zac Medico
2016-05-12 22:09 Mike Frysinger
2016-05-12 21:36 Mike Frysinger
2016-05-11 17:55 Mike Frysinger
2015-11-11  0:56 Mike Frysinger
2015-05-26  3:46 Mike Frysinger
2015-05-04  5:09 Zac Medico
2015-04-20  5:36 Michał Górny
2014-12-02 18:44 Brian Dolbec
2014-11-19 23:26 Michał Górny
2014-10-27 19:28 Zac Medico
2014-10-27 19:28 Zac Medico
2014-10-19 21:11 Brian Dolbec
2014-09-26  2:17 Brian Dolbec

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=1411694533.5346802bc7ca09955020d265b4a15e8ecf67a28f.dol-sen@gentoo \
    --to=brian.dolbec@gmail.com \
    --cc=gentoo-commits@lists.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