[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multi-Line Definitions

From: Eric Blake
Subject: Re: Multi-Line Definitions
Date: Sat, 22 Sep 2007 07:19:25 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070728 Thunderbird/ Mnenhy/

Hash: SHA1

Hi Ralf,

According to Ralf Wildenhues on 9/18/2007 1:31 PM:
> Ignoring that, and assuming we only care about backslash-newline like in
> Eric's example, a patch like the one below would be sufficient, but
> config.h would not be any more readable than if you would not use
> newlines in the first place.  OK to apply?  AFAICS it's a strict
> improvement over what we have now.  OTOH I'm not sure what to do with
> the XFAILing `Define a newline' test we have now in tests/

I agree that your patch is a strict improvement over the current state of
things.  I also like Ralf Corsepius' analysis that, at least for now,
AC_DEFINE should only make sense for the C pre-processor.  My take is that
we could start from this patch, then additionally add some checking that
if the value argument to AC_DEFINE{,_UNQUOTED} is literal, an error is
issued if it contains raw newlines.  And if we do that, then the 'Define a
newline' test should be altered to check that we correctly diagnose
improper use of newline, while letting \-newline through.

> Getting the multi-line values through the whole machinery and at the
> same time allowing values of arbitrary length (thus the need to either
> retain backslash-newlines or insert some after certain lengths) or even
> preserving readability of config.h (thus the need to retain the original
> backslash-newlines) is more work.  Extrapolating from the AC_SUBST work,
> several weeks.  @DEFS@ would be another step ('make' implementations
> have ugly length limits too), but I would not see that as a priority,
> as it can be worked around using AC_CONFIG_HEADERS.

Yes, more could be done, but I think your patch below provided a good
enough start that it is worth checking in a variant of it that also deals
with the `define a newline' test.  I'll see if I can get some time to work
on that idea.

> 2007-09-18  Ralf Wildenhues  <address@hidden>
>       * lib/autoconf/status.m4 (_AC_OUTPUT_HEADER, AC_OUTPUT_MAKE_DEFS):
>       Remove backslash-newline combinations from define values.
>       * doc/autoconf.texi (Defining Symbols): Adjust.
>       * NEWS: Update.
>       * tests/ (#define header templates): Extend test.
>       Suggestion by Eric Lemings.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


reply via email to

[Prev in Thread] Current Thread [Next in Thread]