Eclipse CDT indexer different results for C file than C++ fileWhat are the differences between a pointer variable and a reference variable in C++?Difference between 'struct' and 'typedef struct' in C++?Differences between INDEX, PRIMARY, UNIQUE, FULLTEXT in MySQL?Why is reading lines from stdin much slower in C++ than Python?Can code that is valid in both C and C++ produce different behavior when compiled in each language?GTest with Eclipse CDT - Functions could not be resolved after adding libraryEclipse Mars CDT Makefile project C++14 supportEclipse CDT Oxygen: Compiler issueEclipse-cdt indexer crashes with NullPointerExceptionsEclipse CDT flags extern “C” in header file as syntax error

Why doesn't H₄O²⁺ exist?

Intersection point of 2 lines defined by 2 points each

NMaximize is not converging to a solution

What does "Puller Prush Person" mean?

Important Resources for Dark Age Civilizations?

What's the output of a record needle playing an out-of-speed record

Does an object always see its latest internal state irrespective of thread?

Is it legal for company to use my work email to pretend I still work there?

Convert two switches to a dual stack, and add outlet - possible here?

Is it inappropriate for a student to attend their mentor's dissertation defense?

dbcc cleantable batch size explanation

Why do I get two different answers for this counting problem?

Can a vampire attack twice with their claws using Multiattack?

Add text to same line using sed

RSA: Danger of using p to create q

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

Did Shadowfax go to Valinor?

How can bays and straits be determined in a procedurally generated map?

Modeling an IP Address

Was any UN Security Council vote triple-vetoed?

LWC SFDX source push error TypeError: LWC1009: decl.moveTo is not a function

Malformed Address '10.10.21.08/24', must be X.X.X.X/NN or

Approximately how much travel time was saved by the opening of the Suez Canal in 1869?

How do I deal with an unproductive colleague in a small company?



Eclipse CDT indexer different results for C file than C++ file


What are the differences between a pointer variable and a reference variable in C++?Difference between 'struct' and 'typedef struct' in C++?Differences between INDEX, PRIMARY, UNIQUE, FULLTEXT in MySQL?Why is reading lines from stdin much slower in C++ than Python?Can code that is valid in both C and C++ produce different behavior when compiled in each language?GTest with Eclipse CDT - Functions could not be resolved after adding libraryEclipse Mars CDT Makefile project C++14 supportEclipse CDT Oxygen: Compiler issueEclipse-cdt indexer crashes with NullPointerExceptionsEclipse CDT flags extern “C” in header file as syntax error






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








5















I'm using Eclipse 2018-12 with latest CDT. Getting odd indexing problems with the Editor. Given the below. If the source file has a ".c" extension the indexer complains that type "bool" and "false" cannot be resolved. If the file has a "*.cpp" extension the type is resolved.



In both cases, the project will build and can be debugged.



Not sure if it matters, but I'm using CMake 3.13 to generate Eclipse Project files, although I have tried to manually adjust project settings to no avail.



#include <stdbool.h>
void main(void)

bool success = false;



I have a C Project, but my unit testing is using GTest and are the only .cpp files in the project. All .c files exhibit this behavior.










share|improve this question



















  • 5





    Well bool is a basic type in C++. C didn't have a boolean type until C11 and that is _Bool with stdbool.h having a typedef for bool. So my best guess is it works for C++ files because it's baked into the language. Does your C project need to be configured for the C11 standard?

    – Christian Gibbons
    Feb 22 at 20:54











  • Guess I should add that this is also happening with my own types. I include "map.h". Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();

    – geminicode
    Feb 22 at 20:57











  • "Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();" -- C is different from C++ in that you have to write struct Map map = map_create();, don't you?

    – HighCommander4
    Mar 8 at 1:39

















5















I'm using Eclipse 2018-12 with latest CDT. Getting odd indexing problems with the Editor. Given the below. If the source file has a ".c" extension the indexer complains that type "bool" and "false" cannot be resolved. If the file has a "*.cpp" extension the type is resolved.



In both cases, the project will build and can be debugged.



Not sure if it matters, but I'm using CMake 3.13 to generate Eclipse Project files, although I have tried to manually adjust project settings to no avail.



#include <stdbool.h>
void main(void)

bool success = false;



I have a C Project, but my unit testing is using GTest and are the only .cpp files in the project. All .c files exhibit this behavior.










share|improve this question



















  • 5





    Well bool is a basic type in C++. C didn't have a boolean type until C11 and that is _Bool with stdbool.h having a typedef for bool. So my best guess is it works for C++ files because it's baked into the language. Does your C project need to be configured for the C11 standard?

    – Christian Gibbons
    Feb 22 at 20:54











  • Guess I should add that this is also happening with my own types. I include "map.h". Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();

    – geminicode
    Feb 22 at 20:57











  • "Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();" -- C is different from C++ in that you have to write struct Map map = map_create();, don't you?

    – HighCommander4
    Mar 8 at 1:39













5












5








5








I'm using Eclipse 2018-12 with latest CDT. Getting odd indexing problems with the Editor. Given the below. If the source file has a ".c" extension the indexer complains that type "bool" and "false" cannot be resolved. If the file has a "*.cpp" extension the type is resolved.



In both cases, the project will build and can be debugged.



Not sure if it matters, but I'm using CMake 3.13 to generate Eclipse Project files, although I have tried to manually adjust project settings to no avail.



#include <stdbool.h>
void main(void)

bool success = false;



I have a C Project, but my unit testing is using GTest and are the only .cpp files in the project. All .c files exhibit this behavior.










share|improve this question
















I'm using Eclipse 2018-12 with latest CDT. Getting odd indexing problems with the Editor. Given the below. If the source file has a ".c" extension the indexer complains that type "bool" and "false" cannot be resolved. If the file has a "*.cpp" extension the type is resolved.



In both cases, the project will build and can be debugged.



Not sure if it matters, but I'm using CMake 3.13 to generate Eclipse Project files, although I have tried to manually adjust project settings to no avail.



#include <stdbool.h>
void main(void)

bool success = false;



I have a C Project, but my unit testing is using GTest and are the only .cpp files in the project. All .c files exhibit this behavior.







c++ c indexing eclipse-cdt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 22 at 21:46









howlger

12.1k51943




12.1k51943










asked Feb 22 at 20:42









geminicodegeminicode

261




261







  • 5





    Well bool is a basic type in C++. C didn't have a boolean type until C11 and that is _Bool with stdbool.h having a typedef for bool. So my best guess is it works for C++ files because it's baked into the language. Does your C project need to be configured for the C11 standard?

    – Christian Gibbons
    Feb 22 at 20:54











  • Guess I should add that this is also happening with my own types. I include "map.h". Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();

    – geminicode
    Feb 22 at 20:57











  • "Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();" -- C is different from C++ in that you have to write struct Map map = map_create();, don't you?

    – HighCommander4
    Mar 8 at 1:39












  • 5





    Well bool is a basic type in C++. C didn't have a boolean type until C11 and that is _Bool with stdbool.h having a typedef for bool. So my best guess is it works for C++ files because it's baked into the language. Does your C project need to be configured for the C11 standard?

    – Christian Gibbons
    Feb 22 at 20:54











  • Guess I should add that this is also happening with my own types. I include "map.h". Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();

    – geminicode
    Feb 22 at 20:57











  • "Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();" -- C is different from C++ in that you have to write struct Map map = map_create();, don't you?

    – HighCommander4
    Mar 8 at 1:39







5




5





Well bool is a basic type in C++. C didn't have a boolean type until C11 and that is _Bool with stdbool.h having a typedef for bool. So my best guess is it works for C++ files because it's baked into the language. Does your C project need to be configured for the C11 standard?

– Christian Gibbons
Feb 22 at 20:54





Well bool is a basic type in C++. C didn't have a boolean type until C11 and that is _Bool with stdbool.h having a typedef for bool. So my best guess is it works for C++ files because it's baked into the language. Does your C project need to be configured for the C11 standard?

– Christian Gibbons
Feb 22 at 20:54













Guess I should add that this is also happening with my own types. I include "map.h". Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();

– geminicode
Feb 22 at 20:57





Guess I should add that this is also happening with my own types. I include "map.h". Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();

– geminicode
Feb 22 at 20:57













"Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();" -- C is different from C++ in that you have to write struct Map map = map_create();, don't you?

– HighCommander4
Mar 8 at 1:39





"Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();" -- C is different from C++ in that you have to write struct Map map = map_create();, don't you?

– HighCommander4
Mar 8 at 1:39












2 Answers
2






active

oldest

votes


















0














Found a similar post in an Eclipse forum. Consensus was this might be a Bug in the indexer/editor code.



However there was a workaround solution. It you have a Project with both .c and .cpp files in the project Properties -> C/C++ General -> Language Mappings, add a mapping for "C Source File" to the "GNU C++" Language.



Since my build files are being generated by CMake I don't believe this will impact the way Eclipse Builds/Debugs my code.






share|improve this answer






























    0














    I agree that this is a bug in Eclipse CDT, which I've filed in its bug tracker.






    share|improve this answer

























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54834858%2feclipse-cdt-indexer-different-results-for-c-file-than-c-file%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      Found a similar post in an Eclipse forum. Consensus was this might be a Bug in the indexer/editor code.



      However there was a workaround solution. It you have a Project with both .c and .cpp files in the project Properties -> C/C++ General -> Language Mappings, add a mapping for "C Source File" to the "GNU C++" Language.



      Since my build files are being generated by CMake I don't believe this will impact the way Eclipse Builds/Debugs my code.






      share|improve this answer



























        0














        Found a similar post in an Eclipse forum. Consensus was this might be a Bug in the indexer/editor code.



        However there was a workaround solution. It you have a Project with both .c and .cpp files in the project Properties -> C/C++ General -> Language Mappings, add a mapping for "C Source File" to the "GNU C++" Language.



        Since my build files are being generated by CMake I don't believe this will impact the way Eclipse Builds/Debugs my code.






        share|improve this answer

























          0












          0








          0







          Found a similar post in an Eclipse forum. Consensus was this might be a Bug in the indexer/editor code.



          However there was a workaround solution. It you have a Project with both .c and .cpp files in the project Properties -> C/C++ General -> Language Mappings, add a mapping for "C Source File" to the "GNU C++" Language.



          Since my build files are being generated by CMake I don't believe this will impact the way Eclipse Builds/Debugs my code.






          share|improve this answer













          Found a similar post in an Eclipse forum. Consensus was this might be a Bug in the indexer/editor code.



          However there was a workaround solution. It you have a Project with both .c and .cpp files in the project Properties -> C/C++ General -> Language Mappings, add a mapping for "C Source File" to the "GNU C++" Language.



          Since my build files are being generated by CMake I don't believe this will impact the way Eclipse Builds/Debugs my code.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 27 at 18:35









          geminicodegeminicode

          261




          261























              0














              I agree that this is a bug in Eclipse CDT, which I've filed in its bug tracker.






              share|improve this answer





























                0














                I agree that this is a bug in Eclipse CDT, which I've filed in its bug tracker.






                share|improve this answer



























                  0












                  0








                  0







                  I agree that this is a bug in Eclipse CDT, which I've filed in its bug tracker.






                  share|improve this answer















                  I agree that this is a bug in Eclipse CDT, which I've filed in its bug tracker.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 8 at 1:55

























                  answered Mar 8 at 1:45









                  HighCommander4HighCommander4

                  27.7k1798165




                  27.7k1798165



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54834858%2feclipse-cdt-indexer-different-results-for-c-file-than-c-file%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      1928 у кіно

                      Захаров Федір Захарович

                      Ель Греко