From patchwork Sat Jun 26 20:14:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 57067 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 456F1B6EF3 for ; Sun, 27 Jun 2010 06:14:22 +1000 (EST) Received: (qmail 27170 invoked by alias); 26 Jun 2010 20:14:21 -0000 Received: (qmail 27160 invoked by uid 22791); 26 Jun 2010 20:14:20 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from vsmtp1.tin.it (HELO vsmtp1.tin.it) (212.216.176.141) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 26 Jun 2010 20:14:13 +0000 Received: from [192.168.0.4] (79.47.194.241) by vsmtp1.tin.it (8.0.022) id 4B9917F00AA562FD; Sat, 26 Jun 2010 22:14:10 +0200 Message-ID: <4C265F8A.2070306@oracle.com> Date: Sat, 26 Jun 2010 22:14:02 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100317 SUSE/3.0.4-1.1.1 Thunderbird/3.0.4 MIME-Version: 1.0 To: Kees Cook CC: gcc-patches@gcc.gnu.org Subject: Re: [PATCH v2] libstdc++-v3: add more verifications to testsuite References: <20100625225152.GE4175@outflux.net> In-Reply-To: <20100625225152.GE4175@outflux.net> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 06/26/2010 12:50 AM, Kees Cook wrote: > Hello, > > Here is a patch that adds additional tests to the libstdc++-v3 test suite. > Ubuntu builds packages with -D_FORTIFY_SOURCE=2, so running the suite > shows a few minor warnings. This cleans them up by providing additional > sanity checks around freopen, fgets, and fwrite, as already done in other > places in the testsuite. > > v2: > - Adjusted to not use "!= NULL", as recommended by Paolo Carlini. > Thanks, applied to mainline together with the below small tweak to testsuite_hooks.h (otherwise testsuite/27_io/objects/char/9661-1.cc spuriously fails) Paolo. ///////////////// Index: testsuite/util/testsuite_hooks.h =================================================================== --- testsuite/util/testsuite_hooks.h (revision 161439) +++ testsuite/util/testsuite_hooks.h (working copy) @@ -1,7 +1,8 @@ // -*- C++ -*- // Utility subroutines for the C++ library testsuite. // -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +// 2009, 2010 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -59,7 +60,7 @@ # include # define VERIFY(fn) assert(fn) #else -# define VERIFY(fn) test &= (fn) +# define VERIFY(fn) test &= bool(fn) #endif #ifdef _GLIBCXX_HAVE_UNISTD_H