Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Editor initialisation error for .c files
Editor initialisation error for .c files [message #94827] Fri, 20 February 2004 01:11 Go to next message
Ross is currently offline RossFriend
Messages: 14
Registered: July 2009
Junior Member
Please excuse my ignorance but I have only just started to use CDT and
hence don't know if my problem is a bug, a known limitiation or my own
stupidity.

I downloaded and installed CDT-2.0M7 on eclipse-3.0M7 on linux rh8.

I loaded an existing C project and found that it is unable to open an
editor for my C files. I managed to trace the problem and it appears that
it can't handle any C code that does initialisation of a struct by
element name.

I've found that the following code can't be loaded in an editor from an
existing file (Editor could not be initialized) nor if you type it into a
file can the file be saved (Save Failed:null)

<code>
struct funcs_f {
void (*init)(void);
};

void initfunc(void);

funcs_f functions = {
init: initfunc,
};

void initfunc(void)
{
}
</code>

If I remove or comment out the 'init:' it all works happily.


I couldn't see any references to this type of problem before but thought
I would do a sanity check here before raising a report.

Ross
Re: Editor initialisation error for .c files [message #94946 is a reply to message #94827] Fri, 20 February 2004 16:33 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Try
funcs_f functions = { .init = initfunc };
instead.

The CDT can't open your file because the parser is having trouble with it.
Currently the parser supports ANSI C/C++ and we are in progress of trying to
support the latest GNU (3.3.2). According to
http://gcc.gnu.org/onlinedocs/gcc-3.3.2/gcc/Designated-Inits .html#Designated%20Inits,
your syntax has been obsolete since GCC 2.5.

However, failing the parse should not prevent the file from being opened. So
you should raise a defect in Bugzilla.

-Andrew

"Ross Mark" <rossm@controllingedge.com.au> wrote in message
news:Xns94957CD3DD271rossmcontrollingedge@204.138.98.10...
> Please excuse my ignorance but I have only just started to use CDT and
> hence don't know if my problem is a bug, a known limitiation or my own
> stupidity.
>
> I downloaded and installed CDT-2.0M7 on eclipse-3.0M7 on linux rh8.
>
> I loaded an existing C project and found that it is unable to open an
> editor for my C files. I managed to trace the problem and it appears that
> it can't handle any C code that does initialisation of a struct by
> element name.
>
> I've found that the following code can't be loaded in an editor from an
> existing file (Editor could not be initialized) nor if you type it into a
> file can the file be saved (Save Failed:null)
>
> <code>
> struct funcs_f {
> void (*init)(void);
> };
>
> void initfunc(void);
>
> funcs_f functions = {
> init: initfunc,
> };
>
> void initfunc(void)
> {
> }
> </code>
>
> If I remove or comment out the 'init:' it all works happily.
>
>
> I couldn't see any references to this type of problem before but thought
> I would do a sanity check here before raising a report.
>
> Ross
Re: Editor initialisation error for .c files [message #95038 is a reply to message #94946] Mon, 23 February 2004 01:44 Go to previous message
Ross is currently offline RossFriend
Messages: 14
Registered: July 2009
Junior Member
That works so I've registered a new bug (52788).

Thanks for your help.
Ross


"Andrew Niefer" <aniefer@ca.ibm.com> wrote in
news:c15k3u$ipb$1@eclipse.org:

> Try
> funcs_f functions = { .init = initfunc };
> instead.
>
<snip>
>
> However, failing the parse should not prevent the file from being
> opened. So you should raise a defect in Bugzilla.
>
> -Andrew
Previous Topic:CDT for AIX?
Next Topic:Using MSVC with CDT
Goto Forum:
  


Current Time: Wed Jan 15 07:24:55 GMT 2025

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

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

Back to the top