Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Syntax error reported for designated structure initializers when returning an anonymous structure
Syntax error reported for designated structure initializers when returning an anonymous structure [message #1767046] Thu, 29 June 2017 20:39 Go to next message
Eclipse UserFriend
Eclipse marks the following line as syntax error:

const struct BufferPtr GetBufferPtr() const { return { .ptr = nullptr, .size = 0 }; }


I understand that the support for this construct may be compiler-flavor-dependent, esp. for C++. But is there any way to make Eclipse accept the above as correct t? I'm using Neon.3.

Thank you very much!

Re: Syntax error reported for designated structure initializers when returning an anonymous structur [message #1767061 is a reply to message #1767046] Fri, 30 June 2017 04:17 Go to previous messageGo to next message
Eclipse UserFriend
The named component initialization is a GNU extension, described in section 6.27 Designated Initializers in the GNU C manual.
Re: Syntax error reported for designated structure initializers when returning an anonymous structur [message #1767096 is a reply to message #1767061] Fri, 30 June 2017 12:38 Go to previous message
Eclipse UserFriend
Great info; thanks! But how can I make Eclipse understand this syntax?
Previous Topic:Eclipse NEON CDT is not generating the .O file after build
Next Topic:How to set up library with project file for C++
Goto Forum:
  


Current Time: Fri Mar 21 20:06:09 EDT 2025

Powered by FUDForum. Page generated in 0.03798 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top