Your message dated Sun, 4 Mar 2012 18:57:25 +0100 (CET)
with message-id <[email protected]>
has caused the   report #594851,
regarding indent: Recognizes typedefs in declarations, but not parameters or 
casts; fails to consistently handle "type *"
to be marked as having been forwarded to the upstream software
author(s) [email protected]

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
594851: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594851
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Hello again.

This is the last one from Josh for now.
Apologies to him for taking so long to process this.

---------- Forwarded message ----------
From: Josh Triplett <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Date: Sun, 29 Aug 2010 23:45:40 -0700
Subject: indent: Recognizes typedefs in declarations,
    but not parameters or casts; fails to consistently handle "type *"

Package: indent
Version: 2.2.11-1
Severity: normal

Consider the following file:

void *f1(u32 *p1, void *p2)
{
    u32 *v1;
    void *v2;
    return (void *)v1;
}

u32 *f2(u32 *p1, void *p2)
{
    return (u32 *)v2;
}


"indent -kr -ncas" will indent this as follows:

--- u32.c.orig  2010-08-29 23:38:16.000000000 -0700
+++ u32.c       2010-08-29 23:39:38.000000000 -0700
@@ -1,11 +1,11 @@
-void *f1(u32 *p1, void *p2)
+void *f1(u32 * p1, void *p2)
 {
     u32 *v1;
     void *v2;
     return (void *)v1;
 }

-u32 *f2(u32 *p1, void *p2)
+u32 *f2(u32 * p1, void *p2)
 {
-    return (u32 *)v2;
+    return (u32 *) v2;
 }

Notice how it handled "u32 *v1" and "u32 *f2(...)" correctly and
consistently, but it mis-indented the parameter "u32 * p1" and the cast
"(u32 *) v2".

Ideally, I'd like to see indent automatically handling these types
correctly; the parameters in particular seem like they should prove as
simple as declarations.  However, if it turns out indent can't handle
this without prior knowledge of the program's types, I can live with a
solution that involves explicitly telling indent a list of names which
it should treat as types, since in this case the list would prove quite
short.

- Josh Triplett

[...]


--- End Message ---

Reply via email to