5

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

nirvana9235
  • 655
  • 1
  • 5
  • 7
  • 2
    Please consider filing a bug report: `M-x report-emacs-bug`. The Emacs developers will determine whether or not there is a problem. – Drew Jan 03 '12 at 17:11
  • Please, also report issue to cedet-devel mailing list – Alex Ott Dec 29 '12 at 14:19

2 Answers2

2

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)
Gil Elad
  • 409
  • 2
  • 6
0

This seems like a problem that setting semantic-lex-c-preprocessor-symbol-file could solve. According to what I've read about CEDET, it doesn't just expand every macro willy nilly, but only those defined in semantic-lex-c-preprocessor-symbol-file. So you should add the file, where CURL_DO_LINEEND_CONV is defined to this list. Here's an example:

(add-to-list 'semantic-lex-c-preprocessor-symbol-file
             "~/Software/deal.II/include/deal.II/base/config.h")

Hope this helps.

abo-abo
  • 20,038
  • 3
  • 50
  • 71