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

Using substitution ciphers to generate new alphabets in a novel

Pre-mixing cryogenic fuels and using only one fuel tank

Is there an injective, monotonically increasing, strictly concave function from the reals, to the reals?

Is there a way to get `mathscr' with lower case letters in pdfLaTeX?

Quoting Keynes in a lecture

Can a Canadian Travel to the USA twice, less than 180 days each time?

Calculate sum of polynomial roots

How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?

Plot of a tornado-shaped surface

Keeping a ball lost forever

Can I say "fingers" when referring to toes?

Can a College of Swords bard use a Blade Flourish option on an opportunity attack provoked by their own Dissonant Whispers spell?

How can I write humor as character trait?

Why would a new[] expression ever invoke a destructor?

Why does the Sun have different day lengths, but not the gas giants?

Non-trope happy ending?

How does a computer interpret real numbers?

Does IPv6 have similar concept of network mask?

Temporarily disable WLAN internet access for children, but allow it for adults

Did arcade monitors have same pixel aspect ratio as TV sets?

Can disgust be a key component of horror?

Why is the "ls" command showing permissions of files in a FAT32 partition?

Unexpected behavior of the procedure `Area` on the object 'Polygon'

Biological Blimps: Propulsion



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













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

11.8k51841




11.8k51841










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.5k1798165




                  27.5k1798165



























                      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

                      Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

                      2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

                      Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme