Bug 351795 - The parser shows a problem whenever __func__ is defined saying that the declaration is not found.
Summary: The parser shows a problem whenever __func__ is defined saying that the decla...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 4.7.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2015-08-26 11:01 UTC by Aaron Williams
Modified: 2016-08-26 20:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Williams 2015-08-26 11:01:53 UTC
If I have something in my code like:

printf("%s: Error, argument 6 is incorrect\n", __func__);

 the parser flags this as an error, complaining "Declaration not found:  __func__

Note that __func__ is defined in the C99 standard. This litters a lot of code I work with.

Reproducible: Always

Steps to Reproduce:
#include <stdio.h>

int main(int argc, char *argv[])
{
  printf("This function is %s\n", __func__);
  return 0;
}

3.

Actual Results:  
The editor shows a problem Declaration not found: __func__

Expected Results:  
No error should be displayed because __func__ is part of the C99 standard.
Comment 1 Kevin Funk 2015-08-26 11:18:38 UTC
Same for __FUNCTION__, __PRETTY_FUNCTION__ (although being GCC-specific)

https://gcc.gnu.org/onlinedocs/gcc/Function-Names.html

I'd like to see this fixed as well, I'm also working with an older code base where this litters my problems view.
Comment 2 Kevin Funk 2016-08-26 20:20:44 UTC
Works fine under KDevelop 5.0 with the new Clang backend.