This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR 53889: Add __gthread_recursive_mutex_destroy


On Mon, Oct 01, 2012 at 11:02:27PM -0700, Ian Lance Taylor wrote:
> On Mon, Oct 1, 2012 at 5:46 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> >
> > static inline int
> > __gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t
> >                                    * UNUSED(__mutex))
> > {
> >   return 0;
> > }
> >
> > Is that indentation right?  (the asterisk is in the same column as the
> > parameter type in a fixed-width font.)
> 
> When I see a single parameter that pushes past 80 columns, I normally
> start a new line after the left parenthesis and indent the next line 4
> spaces.  E.g.:
> 
> static inline int
> __gthread_recursive_mutex_destroy (
>     __gthread_recursive_mutex_t * UNUSED(__mutex))
> 
> But I don't think there is any solid standard for this.

I believe the GNU coding standard way (as shown e.g. by what indent does by
default) is to split the single argument onto multiple lines if that still
fits (i.e.
static inline int
__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t
				   * UNUSED(__mutex))
{
  return 0;
}
should be fine), and if even that wouldn't fit, then place ( on the
following line indented by two spaces:
int
foo123456789012345678901234567890123456789012345678901234567890123456789012
  (int x, int y)
{
  return x + y;
}

I have never seen ( at the end of a line in GNU code and find it ugly, but
sure that is a bikeshed thing.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]