Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » #error & indexer
#error & indexer [message #148315] Thu, 07 July 2005 01:48 Go to next message
Eclipse UserFriend
I have some problems with the indexer that seem to be related to #error
statements in header files.

eg

#error "This is a C++ header file; it requires C++ to compile."

CDT 3.0RC1, Eclipse 3.1

Is there a place I can configure something or is this a bug?

Cheers, Patrick
Re: #error & indexer [message #148324 is a reply to message #148315] Thu, 07 July 2005 03:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matthias.digitalraidREMOVETHIS.com

Patrick MacQuillan wrote:
> I have some problems with the indexer that seem to be related to #error
> statements in header files.
>
> eg
>
> #error "This is a C++ header file; it requires C++ to compile."

What is #error? It's not a C++ keyword, that's for sure. Some
proprietary language enhancement I guess, probably MS?

Since it's not part of the language, I wouldn't consider it a bug that
CDT doesn't recognize it.

Regards,
Matthias
Re: #error & indexer [message #148338 is a reply to message #148324] Thu, 07 July 2005 06:00 Go to previous messageGo to next message
Eclipse UserFriend
From http://library.n0i.net/programming/c/cp-iso/cpp.html

A preprocessing directive of the form

# error pp-tokensopt new-line

causes the implementation to produce a diagnostic message that includes
the specified sequence of preprocessing tokens, and renders the program
ill-formed.

I'm kind of hoping it will be supported cause it appears to be nobbling
the indexer.

Matthias Kaeppler wrote:
> Patrick MacQuillan wrote:
>
>> I have some problems with the indexer that seem to be related to
>> #error statements in header files.
>>
>> eg
>>
>> #error "This is a C++ header file; it requires C++ to compile."
>
>
> What is #error? It's not a C++ keyword, that's for sure. Some
> proprietary language enhancement I guess, probably MS?
>
> Since it's not part of the language, I wouldn't consider it a bug that
> CDT doesn't recognize it.
>
> Regards,
> Matthias
Re: #error & indexer [message #148384 is a reply to message #148338] Thu, 07 July 2005 13:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matthias.digitalraidREMOVETHIS.com

Patrick MacQuillan wrote:
> A preprocessing directive of the form
>
> # error pp-tokensopt new-line
>
> causes the implementation to produce a diagnostic message that includes
> the specified sequence of preprocessing tokens, and renders the program
> ill-formed.
>

Oh well, it looks like it is indeed part of the standard. Sorry for the
noise.
Re: #error & indexer [message #148424 is a reply to message #148315] Fri, 08 July 2005 02:38 Go to previous messageGo to next message
Eclipse UserFriend
I have filed a bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=103108


Patrick MacQuillan wrote:
> I have some problems with the indexer that seem to be related to #error
> statements in header files.
>
> eg
>
> #error "This is a C++ header file; it requires C++ to compile."
>
> CDT 3.0RC1, Eclipse 3.1
>
> Is there a place I can configure something or is this a bug?
>
> Cheers, Patrick
Re: #error & indexer [message #148454 is a reply to message #148338] Fri, 08 July 2005 10:40 Go to previous messageGo to next message
Eclipse UserFriend
"Patrick MacQuillan" <patrick.macquillan@motorola.com> wrote in message
news:daiubt$uan$1@news.eclipse.org...
> causes the implementation to produce a diagnostic message that includes
> the specified sequence of preprocessing tokens, and renders the program
> ill-formed.

The indexer is doing exactly what it is supposed to do: producing a
diagnostic message. Everything else is still being indexed.

To get rid of the error, consider whatever #ifdef guard surrounds it and
make sure your predefined paths and symbols are setup properly in your
project properties.

-Andrew
Re: #error & indexer [message #148534 is a reply to message #148454] Sun, 10 July 2005 21:21 Go to previous message
Eclipse UserFriend
Thanks Andrew, my bad - that's exactly what it was - a symbol had not
been defined.

Andrew Niefer wrote:
> "Patrick MacQuillan" <patrick.macquillan@motorola.com> wrote in message
> news:daiubt$uan$1@news.eclipse.org...
>
>>causes the implementation to produce a diagnostic message that includes
>>the specified sequence of preprocessing tokens, and renders the program
>>ill-formed.
>
>
> The indexer is doing exactly what it is supposed to do: producing a
> diagnostic message. Everything else is still being indexed.
>
> To get rid of the error, consider whatever #ifdef guard surrounds it and
> make sure your predefined paths and symbols are setup properly in your
> project properties.
>
> -Andrew
>
>
Previous Topic:SCons support
Next Topic:GDB remote debugging
Goto Forum:
  


Current Time: Sun May 11 11:59:03 EDT 2025

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

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

Back to the top