Skip to content

Commit b7ba858

Browse files
avargitster
authored andcommitted
git-compat-util.h: clarify GCC v.s. C99-specific in comment
Change a comment added in e208f9c (make error()'s constant return value more visible, 2012-12-15). It's not correct that this is GCC-ism anymore, it's code that uses standard C99 features. The comment being changed here pre-dates the HAVE_VARIADIC_MACROS define, which we got in e05bed9 (trace: add 'file:line' to all trace output, 2014-07-12). The original implementation of an error() macro) in e208f9c used a GCC-ism with the paste operator (see the commit message for mention of it), but that was dropped later by 9798f7e (Use __VA_ARGS__ for all of error's arguments, 2013-02-08), giving us the C99-portable version we have now. While we could remove the __GNUC__ define here, it might cause issues for other compilers or static analysis systems, so let's not. See 87fe5df (inline constant return from error() function, 2014-05-06) for one such issue. See also e05bed9 (trace: add 'file:line' to all trace output, 2014-07-12) for another comment about GNUC's handling of __VA_ARGS__. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e6ebfd0 commit b7ba858

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

git-compat-util.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,7 @@ void warning_errno(const char *err, ...) __attribute__((format (printf, 1, 2)));
534534
/*
535535
* Let callers be aware of the constant return value; this can help
536536
* gcc with -Wuninitialized analysis. We restrict this trick to gcc, though,
537-
* because some compilers may not support variadic macros. Since we're only
538-
* trying to help gcc, anyway, it's OK; other compilers will fall back to
539-
* using the function as usual.
537+
* because other compilers may be confused by this.
540538
*/
541539
#if defined(__GNUC__)
542540
static inline int const_error(void)

0 commit comments

Comments
 (0)