This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: warning: unknown escape sequence
- To: Soubhik Bhattacharya <soubhik at cse dot iitk dot ac dot in>
- Subject: Re: warning: unknown escape sequence
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 26 May 2001 05:12:32 -0300
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Organization: GCC Team, Red Hat
- References: <Pine.LNX.4.21.0105261015290.10692-100000@cseproj22.cse.iitk.ac.in>
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