[Bug preprocessor/14789] Preprocessor broken

zack at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Wed Mar 31 00:00:00 GMT 2004


------- Additional Comments From zack at codesourcery dot com  2004-03-31 00:00 -------
Subject: Re:  New: Preprocessor broken

"s_gccbugzilla at nedprod dot com" <gcc-bugzilla@gcc.gnu.org> writes:

> #define DEFINE_MAKECARRAYITER(contType, memberType, getArrayFunction, 
> getArrayFunctionPars, getArrayLengthFunction) \
> 	static iterator_range<memberType *> 
> ##contType##_##getArrayFunction##(contType &c)

I'm going to assume that the word wrap between lines 1 and 2, 3 and 4
of this was unintentional.

> preprocbug.cpp:11:1: pasting ">" and "FXApp" does not give a valid preprocessing 
> token
> preprocbug.cpp:11:1: pasting "FXApp_getArgv" and "(" does not give a valid 
> preprocessing token

These are hard errors for a reason.  They indicate bugs in your code.
A corrected version (with the unused arguments dropped for
readability) would be something like this:

#define DEFINE_MAKECARRAYITER(contType, memberType, getArrayFunction) \
  static iterator_range<memberType *> contType##_##getArrayFunction \
    (contType &c)

i.e. all you have to do is remove two incorrect and unnecessary ##
operators.

zw


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14789



More information about the Gcc-bugs mailing list