0

I have made a rather obvious spelling mistake with directive

#if definded foo

and I received no error message from the compiler. As I understood, 'defined' is a special argument, so I guessed some sytax error should be raised. Am I wrong?

katang
  • 2,474
  • 5
  • 24
  • 48
  • If a pre-processor thing - the compiler does not get a look in – Ed Heal Jan 23 '16 at 11:11
  • It depends on whether `foo` is defined, and how. – n. m. could be an AI Jan 23 '16 at 11:15
  • Thanks for the hint. I understand that it behaves according to the standard. What i still cannot understand: when otherwise C++ is strictly requires definition, and verifies types; why is it good that such an obvious mistype even does not deserve a warning? (I always hated that similar mistypes resulted in FORTRAN automatically created new variables) – katang Jan 23 '16 at 14:05

0 Answers0