There is no error that occurs specifically to call out that there's a conflict. What happens is that the macro processing occurs first, so in a sense macro definitions respect no name spaces - this is one of the main reasons why macros considered bad form and should be avoided except as a last resort. See this question for an example of a situation where someone's perfectly valid use of the name BitTest
for a template was screwed over because someone else decided to create a macro using that name to 'alias' another name: http://stackoverflow.com/questions/2232580/win32-bittest-bittestandcomplement-how-to-disable-this-junk
So in your example, as other answers have mentioned, once the preprocessing step has occurred, you'll end up with something like the following snippet being passed to the C compiler in place of your function definition:
int (int i>int j)? int i : int j{
return (i>j) ? i : j;
}
This isn't valid C, so you'll get a compiler error that might say (from GCC 3.4.5):
error: syntax error before "int"
or (from MSVC 9):
error C2059: syntax error : 'type'
Which really isn't much help, because when you look at the line the error is refering to in your editor, it'll still look like:
int MAX(int i, int j){
which looks valid.
There are several techniques that are used to help avoid the problem:
use all caps for macro names and only macro names; this is a convention that is largely followed to keep the macro namespace separate from names used for other things
put parens around names that you don't want expanded as macros (this only works for 'function-like' macros). If your example had been written as follows:
int (MAX)(int i, int j){
return (i>j) ? i : j;
}
it would not have resulted in the macro expansion. However, I don't see people doing this very often. One set of utility routines I have uses this technique to protect against macro name collisions, and I often get questions about why all the function names are in parens. Also several editors get confused with function navigation for those files.
avoid using macros; as I mentioned this is one reason that macros are considered bad form. There are other reasons including that they can easily cause the expanded form to produce bad or unexpected expressions if you don't properly use parens around macro parameters or by evaluating a macro parameter that has side effects more than once.
Use inline functions or function templates instead if you can.