warning: unknown escape sequence
Alexandre Oliva
aoliva@redhat.com
Sat May 26 01:12:00 GMT 2001
On May 26, 2001, Soubhik Bhattacharya <soubhik@cse.iitk.ac.in> wrote:
> i had the sequences "/*" and "*/" in the fprintf format strings of
> my program. now this is a problem bcoz as i try to comment out a
> portion of my code, the comment terminates prematurely at the point
> where there's a "*/" in the format string
Try #if 0/#endif.
> warning: unknown escape sequence `\*'
> warning: unknown escape sequence `\/'
> i just hate these warnings. is this warning desirable?
A ISO C-compliant compiler must issue a diagnostic, because this is
not a valid escape sequence.
> is it possible to
> write the code in a better way so as to avoid these warning?
If really desperate, try "...*""/..." and let the compiler concatenate
adjacent strings. Any ISO C compiler will do it. But beware: this
won't work with K&R C compilers.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me
More information about the Gcc
mailing list