This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PING^2][PATCH] Reformat malloc to gnu style.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Allan McRae <allan at archlinux dot org>, Siddhesh Poyarekar <siddhesh at redhat dot com>, <libc-alpha at sourceware dot org>
- Date: Thu, 2 Jan 2014 16:28:18 +0000
- Subject: Re: [PING^2][PATCH] Reformat malloc to gnu style.
- Authentication-results: sourceware.org; auth=none
- References: <20131211102701 dot GA25483 at domone dot podge> <20131217095418 dot GA23717 at domone dot podge> <20131230152001 dot GA5214 at domone> <52C2BF2A dot 9010009 at archlinux dot org> <20140101132020 dot GA12317 at domone> <52C4A758 dot 9070802 at archlinux dot org> <20140102034542 dot GG5374 at spoyarek dot pnq dot redhat dot com> <52C50A54 dot 5060906 at archlinux dot org> <20140102090824 dot GA18222 at domone>
Several of the changes committed in commit
6c8dbf00f536d78b1937b5af6f57be47fd376344 are wrong - sufficiently many
that I think it should be reverted, and then smaller patches submitted
after the freeze each of which addresses exactly one formatting issue
(e.g. bad indentation), everywhere it occurs (or only some places it
occurs, if needed to keep the patch below 1000 lines). For example:
* In malloc.c you change "2 * SIZE_SZ" (correct) to "2 *SIZE_SZ"
(incorrect).
* Indentation changes such as
- __THROW __attribute_malloc__ __wur;
+__THROW __attribute_malloc__ __wur;
are wrong (maybe two-column indentation is right - it's what emacs does -
but certainly not zero-column).
* Function pointer declarations are meant to have a space before the open
parenthesis of the parameter list, but you are wrongly removing those
spaces in some cases, e.g.:
-static void (*old_free_hook) (__ptr_t ptr, const __ptr_t);
+static void (*old_free_hook)(__ptr_t ptr, const __ptr_t);
* Similarly in function pointer calls:
- (*old_free_hook) (ptr, caller);
+ (*old_free_hook)(ptr, caller);
* Another case of wrong zero-column indentation you have is:
-static void
-flood (ptr, val, size)
- __ptr_t ptr;
- int val;
- size_t size;
+static void flood (ptr, val, size)
+__ptr_t ptr;
+int val;
+size_t size;
Although prototype definitions are preferred, five-column indentation is
correct in an old-style definition like this.
* I don't follow what logic you are using for indentation in macro
definitions such as arena_get. I reckon the preferred style is
#define macro
do
{
}
while (0)
with backslashes in the positions emacs C-C C-\ puts them in. This
accords with what the GNU Coding Standards say. (Once the braces are on
their own lines, selecting the whole file and doing TAB in emacs is a
convenient way of reindenting and adjusting backslash placement - that's
what I did for soft-fp.)
--
Joseph S. Myers
joseph@codesourcery.com