Bug 372286 - C Parser fails to parse headers and reports errors
Summary: C Parser fails to parse headers and reports errors
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: 5.0.2
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-10 12:20 UTC by aat
Modified: 2022-11-29 05:18 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
screenshot (139.99 KB, image/png)
2016-11-10 12:20 UTC, aat
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aat 2016-11-10 12:20:03 UTC
Created attachment 102156 [details]
screenshot

With this code:

#include <stdlib.h>
#include <stdio.h>

int main() {
  FILE *fil;
  char filename[];
  
  fil = fopen(filename, "rb");
  if(fil == NULL) {
    printf("No file found\n");
    return 0;
  }
  fclose(fil);
  return 1;
}

Parser reports:
Use of undeclared identifier 'FILE'
Implicit declarations of functions fopen, fclose, printf

Parser suggest to include stdio.h and stdlib.h as if they were not found,
however the mouseover on the #include, the box reports correctly all the declarations found in the headers 

Reproducible: Always
Comment 1 Ted 2017-01-02 04:08:45 UTC
This is something that I ran into.  The problem I had was by use of pkg-config in a Makefile that was not resolved by the parser.  I added all of these paths manually into Project->Open Configuration->Includes/Imports.

Also take a look at the "Problems" tab.  If there are any issues shown in RED due to missing include files then the parse will not work at all.
Comment 2 Sven Brauch 2017-01-07 10:44:21 UTC
Ted, I don't think this issue is the same as the one in the original report. The paths in the original report are in the default system include dirs and should always be found without any configuration.

aat, can you try pessing F5? Also, I guess actually compiling the program works ...?
Comment 3 Justin Zobel 2022-10-30 00:37:47 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 4 Bug Janitor Service 2022-11-14 05:15:06 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Bug Janitor Service 2022-11-29 05:18:29 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!