[comp.lang.c] Prototyping macros

Terry_L_Parker@cup.portal.com (10/13/87)

Does the ANSI standard provide any way to prototype #define macros?

For instance:
#define  max(a,b)   (a>b ? a : b)

will accept char's or anything else for the a and b values.  Is it
possible to do something like:

#define max(int a, int b)  (a>b ? a : b)

??

guy%gorodish@Sun.COM (Guy Harris) (10/13/87)

> Is it possible to do something like:
> 
> #define max(int a, int b)  (a>b ? a : b)

No.  This would require the preprocessor, in compilers that use one, to know a
*lot* more about C than current preprocessors tend to know.
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com