Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id EAFA1431FBC for ; Mon, 23 Nov 2009 08:38:13 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IX4hPSHqf4e7 for ; Mon, 23 Nov 2009 08:38:13 -0800 (PST) Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by olra.theworths.org (Postfix) with ESMTP id DFCEE431FAE for ; Mon, 23 Nov 2009 08:38:12 -0800 (PST) Received: by bwz2 with SMTP id 2so5423356bwz.0 for ; Mon, 23 Nov 2009 08:38:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :in-reply-to:references:date:message-id:mime-version:content-type; bh=FXeE7CZm+UTeuS7f2Xr5DoBGPii4HTRC7UzEGOXYdls=; b=IjRfNRMUx6rMkiMZm1orV4kUn/seFyZLSjtz7/7RCtaRKRV2mASJYwuuhPg8NgLSkH 9nlpac00qGxx24eDCxFXdmuovvR/OYv1mr07hvf9kIFkUhFVLFAWT0Ug8Oct9NR1NVCF 6hFJxNknhUZ5npqMILzBEfdOmzFy5n3F6esoQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; b=VaeAlQFCxG+1ss8h7b7uYbCwkYzDVrVo/JZmq5X9MyRQTWcPvfAA+KMIeUIe6NjTsH oLdc9A79sA7HEZjuWZCiZpfLQfMdy8BnmqyCkWfeeOiEU0gDvTF5QuVt5SZRDbK/GhwY Tns5YAc13ghEzIkieF4SEY2LLysnUNvIm7iRA= Received: by 10.204.152.151 with SMTP id g23mr582265bkw.148.1258994291779; Mon, 23 Nov 2009 08:38:11 -0800 (PST) Received: from kunyang (vawpc43.ethz.ch [129.132.59.11]) by mx.google.com with ESMTPS id 22sm5937992fkr.27.2009.11.23.08.38.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 23 Nov 2009 08:38:10 -0800 (PST) Sender: Jed Brown From: Jed Brown To: Dirk-Jan Binnema , Jed Brown In-Reply-To: <1873022c0911230814y783f14ffn23f12d13c73e5acc@mail.gmail.com> References: <87skc5yd6v.wl%djcb@djcbsoftware.nl> <1873022c0911230311o77e55fdqa5464a2dd16ec265@mail.gmail.com> <87ws1h48up.fsf@59A2.org> <1873022c0911230814y783f14ffn23f12d13c73e5acc@mail.gmail.com> Date: Mon, 23 Nov 2009 17:38:42 +0100 Message-ID: <87skc542nh.fsf@59A2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "notmuch@notmuchmail org" , djcb@djcbsoftware.nl Subject: Re: [notmuch] [PATCH 1/2] * avoid gcc 4.4.1 compiler warnings due to ignored write return values X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 16:38:14 -0000 On Mon, 23 Nov 2009 18:14:12 +0200, Dirk-Jan Binnema wrote: > Did you try it with -O2? Without optimizations many of the warnings are not > issued. Yes, $ cat > foo.c #include #include int main() { malloc(5); write(2,0,10); return 0; } $ gcc -static -std=c89 -O0 -Wall -Wextra -pedantic -o foo foo.c $ objdump -d -M intel foo |grep -A12 '
' 00000000004002a4
: 4002a4: 55 push rbp 4002a5: 48 89 e5 mov rbp,rsp 4002a8: bf 05 00 00 00 mov edi,0x5 4002ad: e8 6e 61 00 00 call 406420 <__libc_malloc> 4002b2: ba 0a 00 00 00 mov edx,0xa 4002b7: be 00 00 00 00 mov esi,0x0 4002bc: bf 02 00 00 00 mov edi,0x2 4002c1: e8 ea a0 00 00 call 40a3b0 <__libc_write> 4002c6: b8 00 00 00 00 mov eax,0x0 4002cb: c9 leave 4002cc: c3 ret 4002cd: 90 nop $ gcc -v Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-threads=posix --mandir=/usr/share/man --infodir=/usr/share/info --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic Thread model: posix gcc version 4.4.2 (GCC) $ uname -a Linux kunyang 2.6.31-ARCH #1 SMP PREEMPT Tue Nov 10 19:01:40 CET 2009 x86_64 Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz GenuineIntel GNU/Linux Seems fishy. Jed