Comment delimiter in string

Dave Brolley brolley@cygnus.com
Fri Jun 5 12:30:00 GMT 1998


Alexandre Oliva wrote:

> >    /* fprintf(stdout, "/* %s */", 1 ? "Maximal" : "Not!"); */
>
> This is interpreted as:
>
>      ", 1 ? "Maximal" : "Not!"); */
>
> which is clearly in error.  Comments do not nest in ANSI/ISO C, AFAIK

Comments do not nest: correct. Therefore the comment ends at the first */ just
before the ", 1.....". The interpretation is correct.

Dave




More information about the Gcc-bugs mailing list