Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Format typedefs correctly
Format typedefs correctly [message #908736] Wed, 05 September 2012 23:14 Go to next message
Jonas Nyrup is currently offline Jonas NyrupFriend
Messages: 2
Registered: September 2012
Junior Member
In my C code I have this code
#define Color int_fast16_t
Color var1;
Color var2;

/* Returns the vertex of maximal degree */
Color getColor();



When I use the formatter in Eclipse for some reason it removes some linebreaks that it shouldn't.
#define Color int_fast16_t
Color var1;Color var2;

/* Returns the vertex of maximal degree */Color getColor();

How do I get Eclipse to recognize my typedef and format correctly?

[Updated on: Thu, 06 September 2012 11:30]

Report message to a moderator

Re: Format typedefs correctly [message #909023 is a reply to message #908736] Thu, 06 September 2012 12:37 Go to previous messageGo to next message
Sunil Matta is currently offline Sunil MattaFriend
Messages: 8
Registered: April 2012
Junior Member
Two points.
I have typedefs all over and I dont get bad formatting in Juno. Does this only happen after you do your defines ?
You really want to use typedef instead of textual substitution. That is the preferred method for defining types.
Re: Format typedefs correctly [message #909051 is a reply to message #909023] Thu, 06 September 2012 13:11 Go to previous message
Jonas Nyrup is currently offline Jonas NyrupFriend
Messages: 2
Registered: September 2012
Junior Member
I normally uses Indigo as it is in the default repositories for my Linux distribution, but I've just tried to download the newest Juno CDT release and the problem consists.

When I manually substitutes "Color" with "int_fast16_t" the problem disappears. But as you mention, typedefs are preferred.
Previous Topic:Access to GNU-Tools
Next Topic:Bad user interface design
Goto Forum:
  


Current Time: Sat Apr 20 00:30:42 GMT 2024

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

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

Back to the top