[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:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
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/torture.at.
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/torture.at (#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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG9RZd84KuGfSFAYARAjINAKC2rDsZBIqvsk1mHK0LrMzbI3MqdwCbBKaD
J0FaFnAADTSVBc31jEgaag4=
=uo9P
-----END PGP SIGNATURE-----
- Re: Multi-Line Definitions, Ralf Wildenhues, 2007/09/18
- RE: Multi-Line Definitions, Eric Lemings, 2007/09/18
- Re: Multi-Line Definitions,
Eric Blake <=
- Re: Multi-Line Definitions, Eric Blake-1, 2007/09/27
- Re: Multi-Line Definitions, Ralf Wildenhues, 2007/09/29
- Re: Multi-Line Definitions, Eric Blake, 2007/09/29
- Re: Multi-Line Definitions, Eric Blake, 2007/09/29
- m4 regex usage [was: Multi-Line Definitions], Eric Blake, 2007/09/29
- m4sugar speedups [was: Multi-Line Definitions], Eric Blake, 2007/09/29
- Re: m4sugar speedups [was: Multi-Line Definitions], Benoit SIGOURE, 2007/09/30
- Re: m4sugar speedups [was: Multi-Line Definitions], Eric Blake, 2007/09/30