git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
	"Michael Haggerty" <mhagger@alum.mit.edu>,
	"Jonathan Nieder" <jrnieder@gmail.com>
Subject: Re: [PATCH 8/8] Enable GIT_DEBUG_MEMCHECK on git_pathname()
Date: Thu, 17 Nov 2011 08:42:01 -0500	[thread overview]
Message-ID: <20111117134201.GA30718@sigill.intra.peff.net> (raw)
In-Reply-To: <CALkWK0ndE1Q_jNSV7CBB5W2NyVhcy7kgNO5woWWOw6CXx3cxcA@mail.gmail.com>

On Thu, Nov 17, 2011 at 04:05:52PM +0530, Ramkumar Ramachandra wrote:

> The macros __FILE__, __LINE__ and __VA_ARGS__ are gcc-specific
> extensions, no?  I was curious to see if some other parts of Git are
> using this: a quick grep returns mailmap.c and notes-merge.c.  They
> both use __VA_ARGS__ it for debugging purposes.  So, nothing new.

All three are in C99. I'm pretty sure __FILE__ and __LINE__ were
available in C89, but I only have a copy of C99 handy these days.
Variable-argument macros were definitely introduced in C99 (and were a
gcc extension for a while before then).

> What happens if GIT_DEBUG_MEMCHECK is set, but I'm not using gcc?
> Also, it's probably worth mentioning in the commit message that this
> debugging trick is gcc-specific.

Older compilers will probably barf on the variable-argument macros.

-Peff

  reply	other threads:[~2011-11-17 13:42 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-17  9:32 [PATCH 0/8] nd/resolve-ref v2 Nguyễn Thái Ngọc Duy
2011-11-17  9:32 ` [PATCH 1/8] Convert many resolve_ref() calls to read_ref*() and ref_exists() Nguyễn Thái Ngọc Duy
2011-11-17  9:32 ` [PATCH 2/8] Rename resolve_ref() to resolve_ref_unsafe() Nguyễn Thái Ngọc Duy
2011-11-17  9:32 ` [PATCH 3/8] Re-add resolve_ref() that always returns an allocated buffer Nguyễn Thái Ngọc Duy
2011-11-17  9:32 ` [PATCH 4/8] cmd_merge: convert to single exit point Nguyễn Thái Ngọc Duy
2011-11-17 10:39   ` Ramkumar Ramachandra
2011-11-17 10:44     ` Jonathan Nieder
2011-11-17  9:32 ` [PATCH 5/8] Use resolve_ref() instead of resolve_ref_unsafe() Nguyễn Thái Ngọc Duy
2011-11-17  9:32 ` [PATCH 6/8] Convert resolve_ref_unsafe+xstrdup to resolve_ref Nguyễn Thái Ngọc Duy
2011-11-17 10:22   ` Ramkumar Ramachandra
2011-11-18  0:57     ` Nguyen Thai Ngoc Duy
2011-11-17  9:32 ` [PATCH 7/8] Guard memory overwriting in resolve_ref_unsafe's static buffer Nguyễn Thái Ngọc Duy
2011-11-17  9:32 ` [PATCH 8/8] Enable GIT_DEBUG_MEMCHECK on git_pathname() Nguyễn Thái Ngọc Duy
2011-11-17 10:35   ` Ramkumar Ramachandra
2011-11-17 13:42     ` Jeff King [this message]
2011-11-18  1:12       ` Nguyen Thai Ngoc Duy
2011-11-18  1:27         ` Jeff King
2011-11-18  1:36           ` Jonathan Nieder
2011-11-18  1:50           ` Nguyen Thai Ngoc Duy
2011-11-18  2:06             ` Jeff King
2011-11-18  1:27         ` Jonathan Nieder
2011-11-18  6:16           ` Johan Herland
2011-11-18  6:52             ` Jonathan Nieder
2011-11-18  7:35             ` Junio C Hamano
2011-11-18 12:50       ` Bernhard R. Link
2011-11-17 10:39 ` [PATCH 0/8] nd/resolve-ref v2 Jonathan Nieder
2011-12-06 14:07   ` Nguyen Thai Ngoc Duy

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=20111117134201.GA30718@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=mhagger@alum.mit.edu \
    --cc=pclouds@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).