prev up next   top/contents search

comp.lang.c FAQ list · Question 17.4b

Q: I've seen function declarations that look like this:

extern int func __((int, int));
What are those extra parentheses and underscores for?

A: They're part of a trick which allows the prototype part of the function declaration to be turned off for a pre-ANSI compiler. Somewhere else is a conditional definition of the __ macro like this:

	#ifdef __STDC__
	#define __(proto) proto
	#define __(proto) ()
The extra parentheses in the invocation
	extern int func __((int, int));
are required so that the entire prototype list (perhaps containing many commas) is treated as the single argument expected by the macro.

Additional links: further reading

prev up next   contents search
about this FAQ list   about eskimo   search   feedback   copyright

Hosted by Eskimo North