This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCH v6 6/6] linux ttyname and ttyname_r: Add tests


On Sun, Nov 12, 2017 at 05:23:31PM +0100, Florian Weimer wrote:
> * Christian Brauner:
> 
> > Some variable declarations in the middle-of-the stack I pointed out
> > before are still left. I don't see this coding style used in the
> > codebase a lot but if people don't care and are fine with this I
> > don't care.
> 
> In new code, we generally tend to reduce the scope of declarative
> regions.

Ha, ok. Thanks! I mean what I don't like is not small scopes but variable
declarations not at the beginning of a new scope. So to illustrate:

void foo()
  {
    int m, n, p;
    /* do stuff */

    if (bla)
      {
        /* new scope begins so it's fine to declare variable's here. */
	int a, b, c;

	/* do other stuff */
      }

      /* old scope --> Variable declarations here is what I find odd regardless
       * of C standard */
       int i, k, j;
  }

Is the latter encouraged, Florian?

Christian

Attachment: signature.asc
Description: PGP signature


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