Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cedet parsing issue on #ifdef

Tags:

emacs

cedet

I 'm emacs cedet user. i got great help from cedet.

but, I found some error prcessing #ifdef handling in cedet. not sure it's from cedet internal or my mis-configuration. I quote some code in Curl where this issue happens.

#ifdef CURL_DO_LINEEND_CONV
  if((data->set.crlf) || (data->set.prefer_ascii)) {
#else
  if(data->set.crlf) {
#endif /* CURL_DO_LINEEND_CONV */
    endofline_native  = "\n";

With this code, there must be some mis-parenthesis match. Because I got errors using (eassist-list-methods) or other cedet-semantic functions (jump to definition).

I could easily guess this might be from two braces in #ifdef .. #endif block. I contracted these to like this.

#ifdef CURL_DO_LINEEND_CONV
  if((data->set.crlf) || (data->set.prefer_ascii)) 
#else
  if(data->set.crlf) 
#endif /* CURL_DO_LINEEND_CONV */
{
    endofline_native  = "\n";

after this, cedet semantic functions works well.

any idea about this? is it from cedet parser problem?

if there is some point I have to configure in cedet, could you give me some insight ?

thanks

like image 305
nirvana9235 Avatar asked Nov 04 '22 15:11

nirvana9235


1 Answers

A bit late to the party, but in case anyone is still struggling with this, add the following line to to your emacs init file:

(setq semantic-c-obey-conditional-section-parsing-flag nil)
like image 136
Gil Elad Avatar answered Nov 13 '22 03:11

Gil Elad