C syntax problem in gcc

Mo McKinlay mmckinlay@labs.interopen.org
Wed Apr 5 11:55:00 GMT 2000


# For this source code:
# 
#   typedef int x;
#   void proc(int (*x)(void)) {}

gcc 2.95.2 gives the same error; although personally I'm not sure whether
it's correct in its asessment or not. In the short term, though, may I
suggest writing something similar to:

typedef int x;

typedef int (*xfn_t)(void);

void proc(xfn_t x) {}

Which compiles fine.

My gut feeling is that your code is ambiguous, although I'm no expert (and
I'm probably wrong ;-).

Regards,

-- 
Mo McKinlay             Chief Software Architect              inter/open
mmckinlay@labs.interopen.org                    http://www.interopen.org



More information about the Gcc-bugs mailing list