git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Johannes Sixt <j6t@kdbg.org>
Cc: git@vger.kernel.org
Subject: [PATCH/RFCv2 0/2] compiling git with gcc -O3 -Wuninitialized
Date: Sat, 15 Dec 2012 12:36:21 -0500	[thread overview]
Message-ID: <20121215173621.GA21011@sigill.intra.peff.net> (raw)
In-Reply-To: <20121215110930.GA23727@sigill.intra.peff.net>

On Sat, Dec 15, 2012 at 06:09:30AM -0500, Jeff King wrote:

> > Does
> > 
> >   #define error(fmt, ...) (error_impl(fmt, __VA_ARGS__), -1)
> > 
> > cause problems when not used in a return statement?
> 
> Thanks, that was the cleverness I was missing.

Here it is as patches. One problem with this method is that if the
function implementation ever changes to _not_ return -1, then we get no
warning that our macro and the function implementation have diverged in
meaning.

  [1/2]: make error()'s constant return value more visible
  [2/2]: silence some -Wuninitialized false positives

These would go on top of 1/3 from the original series to make -Wall -O3
clean (I'll repost the series as a whole when it is more obvious what we
want to do).

-Peff

  reply	other threads:[~2012-12-15 17:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-14 22:09 [PATCH/RFC 0/3] compiling git with gcc -O3 -Wuninitialized Jeff King
2012-12-14 22:11 ` [PATCH 1/3] remote-testsvn: fix unitialized variable Jeff King
2012-12-15 10:29   ` Florian Achleitner
2012-12-14 22:12 ` [PATCH/RFC 2/3] inline error functions with constant returns Jeff King
2012-12-14 22:13 ` [PATCH/RFC 3/3] silence some -Wuninitialized warnings around errors Jeff King
2012-12-15  3:07 ` [PATCH/RFC 0/3] compiling git with gcc -O3 -Wuninitialized Nguyen Thai Ngoc Duy
2012-12-15 10:09   ` Jeff King
2012-12-15 10:49 ` Johannes Sixt
2012-12-15 11:09   ` Jeff King
2012-12-15 17:36     ` Jeff King [this message]
2012-12-15 17:37       ` [PATCH 1/2] make error()'s constant return value more visible Jeff King
2012-12-15 17:42       ` [PATCH 2/2] silence some -Wuninitialized false positives Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121215173621.GA21011@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).