From: Akim Demaille Date: Thu, 14 Nov 2002 08:17:46 +0000 (+0000) Subject: * doc/autoconf.texi (C Compiler): Solitary backslashes. X-Git-Tag: AUTOCONF-2.55~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4aa948e894834891e4b0d3387bc3aee8932d82a7;p=thirdparty%2Fautoconf.git * doc/autoconf.texi (C Compiler): Solitary backslashes. From Paul Eggert and Albert Chin-A-Young. --- diff --git a/ChangeLog b/ChangeLog index bcfb8e3e4..def5e2445 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-11-14 Akim Demaille + + * doc/autoconf.texi (C Compiler): Solitary backslashes. + From Paul Eggert and Albert Chin-A-Young. + 2002-11-14 Kevin Ryde * lib/autoconf/c.m4 (AC_LANG_FUNC_LINK_TRY(C)): Initialize f=$1 rather diff --git a/doc/autoconf.texi b/doc/autoconf.texi index f4135b870..ff14a8c2b 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -4943,6 +4943,43 @@ defines @code{SIZEOF_INT_P} to be 8 on DEC Alpha AXP systems. @node C Compiler @subsection C Compiler Characteristics +The following macros provide ways to find and exercise a C Compiler. +There are a few constructs that ought to be avoided, but do not deserve +being checked for, since they can easily be worked around. + +@table @asis +@item Don't use lines containing solitary backslashes +They tickle a bug in the HP-UX C compiler (checked on HP-UX 10.20, +11.00, and 11i). Running the compiler on the following source, + +@example +#ifdef __STDC__ +/\ +* A comment with backslash-newlines in it. %@{ %@} *\ +\ +/ +char str[] = "\\ +" A string with backslash-newlines in it %@{ %@} \\ +""; +char apostrophe = '\\ +\ +'\ +'; +#endif +@end example + +@noindent +yields + +@example +@error{}cpp: "foo.c", line 13: error 4048: Non-terminating comment at end of file. +@error{}cpp: "foo.c", line 13: error 4033: Missing #endif at end of file. +@end example + +@noindent +Removing the lines with solitary backslashes solves the problem. +@end table + @defmac AC_PROG_CC (@ovar{compiler-search-list}) @acindex PROG_CC @ovindex CC