Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327215

Summary: Syntax error if using va_arg macro
Product: [Tools] CDT Reporter: Filipp Andjelo <filipp.andjelo>
Component: cdt-parserAssignee: Project Inbox <cdt-parser-inbox>
Status: RESOLVED WORKSFORME QA Contact: Mike Kucera <mikekucera>
Severity: normal    
Priority: P3    
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Filipp Andjelo CLA 2010-10-07 07:49:44 EDT
Build Identifier: M20100909-0800

C/C++ parser seems to have problems with va_arg(...) macro. Following code is clean for g++ compiler, but CDT Editor reports syntax error:

void foo(int i, ...) {
  va_list argp;
  va_start(argp, i);
  int i = va_arg(argp, int); // <-- syntax error in this line
  va_end(argp);
}

Reproducible: Always

Steps to Reproduce:
1. Try to use va_arg() macro
Comment 1 Markus Schorn CLA 2010-10-07 10:08:56 EDT
The va_arg() macro is not pre-defined, it is defined in <stdarg.h>. Include this header and make sure that the indexer can resolve it (configure include search path).

If that does not work, please create a parser log for the file (context menu of file in projet explorer - Index - Create Parser Log) and attach it and reopen the bug.