Date: 20 May 2004 16:03:31 -0400 From: Lowell Gilbert <freebsd-questions-local@be-well.ilk.org> To: freebsd-questions@freebsd.org Subject: Re: c compiler Message-ID: <44vfiqvpbg.fsf@be-well.ilk.org> In-Reply-To: <200405201900.i4KJ0h5P046853@whoweb.com> References: <200405201900.i4KJ0h5P046853@whoweb.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Jon <mailist@whoweb.com> writes:
> I'm looking for some quick help with the 5.2.1 C compiler. In FBSD 4.x
> I could write multi-line printf() statements with embedded new-lines
> such as:
>
> printf("
> hello,
> this
> is
> a
> test");
>
>
> In 5.2.1, the newlines have to be preceeded with a "\" character. Since
> I have some large programs with lots of printf() statements that include
> embedded new-lines, I'm not looking forward to going through thousands
> of lines of code to add "\" characters. Is there any command line
> option
> option to "cc" (didn't find one in the manpage) or other way to compile
> my old code the way it is?
I don't think so. It is (and, I believe, always was) illegal
according to the C standard, and it had been been deprecated in gcc
for several years (with appropriate warnings in the 3.x GCC releases).
You'll need to convert your code to be valid C or take it up with the
GCC developers.
Time for an awk script, I think.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44vfiqvpbg.fsf>
