Question: Usually, if a `*/`*(block comment closing)* is present in the code without a `/*`*(block comment opening)*, the compiler produces an error.

However, why does the compiler ***NOT*** produce an error in the following case?

```c
#include <stdio.h>
int main(void)
{
    #ifdef abcd
    printf("what ever it is");
    #endif */   --> the problem with this stray '*/' after #endif
    return 0;
}

```

Answer: 
Educated guess: this is strictly a bug in the preprocessor, and what it does is ignore everything after an `#endif`, which can't be followed by anything anyways.
First, since `*/` is not part a comment, it is ignored in translation phase 3, described in C 2011 (n1570) 5.1.1.2 1 3.; the characters simply pass through unchanged.

Thus, in phase 4 (executing preprocessor directives), the compiler sees `#endif */`. Per C 2011 (n1570) 6.10 1, the proper syntax for an `#endif` directive is:

```
# endif new-line

```

That is, it consists of three preprocessing tokens, `#`, `endif`, and a new-line character, with spaces and tabs allowed between the tokens. So `#endif */` is not proper syntax.

5.1.1.3 requires a conforming implementation to produce a diagnostic message if the source violates a syntax rule. So, if a compiler does not produce a warning or error message in this case, it is not conforming.

Some compilers operate by default in a mode that does not conform to the C standard. Your compiler might have switches to change this, such as GCC’s `-std=c99` switch. If your compiler does not issue a warning or error message when in a conforming mode, then it is a bug.