From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya3bG-0008FQ-Rm for qemu-devel@nongnu.org; Mon, 23 Mar 2015 10:45:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ya3bD-0001bq-My for qemu-devel@nongnu.org; Mon, 23 Mar 2015 10:45:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya3bD-0001Yr-GG for qemu-devel@nongnu.org; Mon, 23 Mar 2015 10:45:03 -0400 Message-ID: <551026EA.5040401@redhat.com> Date: Mon, 23 Mar 2015 10:44:58 -0400 From: John Snow MIME-Version: 1.0 References: <1426791697-17895-1-git-send-email-jsnow@redhat.com> <1426791697-17895-3-git-send-email-jsnow@redhat.com> <20150323130330.GF9268@stefanha-thinkpad.redhat.com> In-Reply-To: <20150323130330.GF9268@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 2/4] configure: factor out supported flag check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, stefanha@redhat.com On 03/23/2015 09:03 AM, Stefan Hajnoczi wrote: > On Thu, Mar 19, 2015 at 03:01:35PM -0400, John Snow wrote: >> +cc_has_warning_flag() { >> + if [ "$2" != "--keep-tmpc" ]; then >> + write_c_skeleton; >> + fi >> + >> # Use the positive sense of the flag when testing for -Wno-wombat >> # support (gcc will happily accept the -Wno- form of unknown >> # warning options). >> - optflag="$(echo $flag | sed -e 's/^-Wno-/-W/')" >> - if compile_prog "-Werror $optflag" "" ; then >> - QEMU_CFLAGS="$QEMU_CFLAGS $flag" >> + optflag="$(echo $1 | sed -e 's/^-Wno-/-W/')" >> + compile_prog "-Werror $optflag" "" >> +} >> + >> +write_c_skeleton; >> +for flag in $gcc_flags; do >> + if cc_has_warning_flag $flag --keep-tmpc; then > > The only caller that uses --keep-tmpc wants TMPC to be the skeleton > program anyway. The option can be dropped and the write_c_skeleton in > cc_has_warning_flag can be unconditional. > > Stefan > I just figured there was no use in rewriting the same skeleton file unconditionally in a loop. The helper is used later where we do want to regenerate the skeleton. If you still want me to just make it unconditional, I can, but I don't see the point. --js