cutemiex
cutemiex

Reputation: 1

Cedet cannot properly parse the time.h under /usr/include

I configured my cedet almost the same with http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html.

Thanks alexott , most of the time it works well, but I found that it can not well parse the tm struct in /usr/include/time.h.

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
int main(void){
    struct tm times;
    FILE file;
}

When using M-x semantic-ia-fast-jump, the struct FILE is correct, but semantic finds the struct tm in wchar.h, not in time.h. The problem seems to be there is a forward declaration in wchar.h for the struct tm.

Upvotes: 0

Views: 245

Answers (1)

Eric
Eric

Reputation: 3949

In my copy of time.h, it appears that the symbol __BEGIN_NAMESPACE_STD is showing up in front of the struct declaration, and is befuddling the parser. You can fix that quickly by just adding that and __END_NAMESPACE_STD to the variable semantic-lex-c-preprocessor-symbol-map as mapping to empty. Then delete your semanticdb cache files (in ~/.semanticdb) related to time.h, or just everything in /usr/include, and restart emacs. time.h should get reparsed, and things should work ok for time.h after that... unless you want to use std::tm or something.

Upvotes: 1

Related Questions