This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: C syntax problem in gcc



# 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]