This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: warning: unknown escape sequence

On May 26, 2001, Soubhik Bhattacharya <> 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
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist    *Please* write to mailing lists, not to me

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]