struct initialization with open brace placed in a newline

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

struct initialization with open brace placed in a newline

Fangrui Song via cfe-dev
Hi,

I would like to ask if it is possible when initializing a C struct to have open brace "{" placed in a newline.
For example if we have the following struct:

struct point
{
int x;
int y;
}

and we want to initialize it, can we have this:

struct point A = 
{
  .x = 2;
  .y = 3;
}

and not this one:

struct point A = {
  .x = 2;
  .y = 3;
}

Best regards,
Kostas



_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev