pycparserext icon indicating copy to clipboard operation
pycparserext copied to clipboard

Parse error on function with attribute returning a pointer

Open asciiiii opened this issue 12 years ago • 1 comments

This code is OK:

int __attribute__((__nothrow__)) fct() {}

but this one failed:

int * __attribute__((__nothrow__)) fct() {}

Error given is: pycparser.plyparser.ParseError: :1:7: before: __attribute__

I tried to fix this bug myself, without success.

I discovered that when trying to parse stdio.h from Mingw. Preprocessed sample:

  __attribute__ ((__dllimport__)) FILE *__attribute__((__cdecl__)) _fsopen(const char *_Filename,const char *_Mode,int _ShFlag);

asciiiii avatar Dec 21 '13 11:12 asciiiii

Thanks for reporting this issue. I unfortunately do not have the spare cycles to debug this at this moment, but I'd be happy to take a patch.

inducer avatar Dec 22 '13 21:12 inducer