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

                      Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

                      Posting a File and Associated Data to a RESTful WebService preferably as JSON2019 Community Moderator ElectionREST URI convention - Singular or plural name of resource while creating itUploading both data and files in one form using Ajax?How do I upload a file with metadata using a REST web service?REST API - file (ie images) processing - best practicesSpring: JSON data and file in the same requestREST API Put large dataPosting a file and JSON data to Spring rest serviceRESTful Web Service Upload/Download Large Data With JSONREST API Design sending JSON data and a file to the api in same requestPost JSONArray to REST servicePUT vs. POST in RESTParsing values from a JSON file?JavaScript/jQuery to download file via POST with JSON dataHow do I upload a file with metadata using a REST web service?How to POST JSON data with Curl from Terminal/Commandline to Test Spring REST?Separate REST JSON API server and client?what's the correct way to send a file from REST web service to client?How do I write JSON data to a file?What is “406-Not Acceptable Response” in HTTP?REST API - file (ie images) processing - best practices

                      How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page